xling 0.10.1 → 0.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/dist/{backend-router-aOcWH4J_.js → backend-router-BVglKdTL.js} +1 -1
  2. package/dist/{base-Cb8gvSZx.js → base-ES3hc6uu.js} +1 -1
  3. package/dist/{claude-CgDMZ5NR.js → claude-BJ1kVclm.js} +1 -1
  4. package/dist/{claude-BOK95KeO.js → claude-BqDhM0_U.js} +1 -1
  5. package/dist/{codex-Czpk7Br1.js → codex-DO3xGhyb.js} +1 -1
  6. package/dist/codex-Kk3Sv7uC.js +1 -0
  7. package/dist/commands/git/prc.js +1 -1
  8. package/dist/commands/git/prr.js +1 -1
  9. package/dist/commands/git/prv.js +1 -1
  10. package/dist/commands/git/worktree.js +1 -1
  11. package/dist/commands/git/wta.js +1 -1
  12. package/dist/commands/git/wtl.js +1 -1
  13. package/dist/commands/git/wtp.js +1 -1
  14. package/dist/commands/git/wtr.js +1 -1
  15. package/dist/commands/git/wts.js +1 -1
  16. package/dist/commands/p/index.js +1 -1
  17. package/dist/commands/settings/auth.js +1 -1
  18. package/dist/commands/settings/get.js +1 -1
  19. package/dist/commands/settings/inspect.js +1 -1
  20. package/dist/commands/settings/list.js +1 -1
  21. package/dist/commands/settings/set.js +1 -1
  22. package/dist/commands/settings/switch.js +4 -4
  23. package/dist/commands/settings/sync.js +1 -1
  24. package/dist/commands/sx/index.js +1 -1
  25. package/dist/commands/version/index.js +1 -1
  26. package/dist/commands/x/index.js +2 -2
  27. package/dist/{create-C3P6UYhE.js → create-CoP40LJP.js} +1 -1
  28. package/dist/{dispatcher-KWhvzTOg.js → dispatcher-CrrrsRFX.js} +1 -1
  29. package/dist/{dispatcher-CIOJuMxR.js → dispatcher-DOZzJY8q.js} +1 -1
  30. package/dist/{dispatcher-CPtFZ27f.js → dispatcher-gwnQwr6V.js} +1 -1
  31. package/dist/{gemini-Bf13TKO0.js → gemini-DjOdjVmz.js} +1 -1
  32. package/dist/{pr-BNviK79Q.js → pr-B-Wvra01.js} +1 -1
  33. package/dist/{runner-BEeIEt9y.js → runner-BDDl4-Yr.js} +1 -1
  34. package/dist/runner-DfsWnEWI.js +1 -0
  35. package/dist/services/git/create.js +1 -1
  36. package/dist/services/git/dispatcher.js +1 -1
  37. package/dist/services/git/pr.js +1 -1
  38. package/dist/services/git/utils.js +1 -1
  39. package/dist/services/git/view.js +1 -1
  40. package/dist/services/git/worktree.js +1 -1
  41. package/dist/services/launch/adapters/base.js +1 -1
  42. package/dist/services/launch/adapters/claude.js +1 -1
  43. package/dist/services/launch/adapters/codex.js +1 -1
  44. package/dist/services/launch/adapters/gemini.js +1 -1
  45. package/dist/services/launch/dispatcher.js +1 -1
  46. package/dist/services/p/backend-router.js +1 -1
  47. package/dist/services/settings/adapters/claude.js +1 -1
  48. package/dist/services/settings/adapters/codex.js +1 -1
  49. package/dist/services/settings/adapters/gemini.js +1 -1
  50. package/dist/services/settings/dispatcher.js +1 -1
  51. package/dist/services/settings/sync.js +1 -1
  52. package/dist/services/settings/templates/claudeDefault.js +1 -1
  53. package/dist/services/shortcuts/runner.js +1 -1
  54. package/dist/services/shortcuts/types.js +1 -1
  55. package/dist/utils/runner.d.ts +14 -1
  56. package/dist/utils/runner.js +1 -1
  57. package/dist/{utils-DugkWRYo.js → utils-7jommWkE.js} +1 -1
  58. package/dist/{view-zF4lc17m.js → view-D96BK69H.js} +1 -1
  59. package/dist/{worktree-CrkzOfkB.js → worktree-D9lv01RB.js} +1 -1
  60. package/package.json +1 -1
  61. package/dist/codex-B8t10wtW.js +0 -1
  62. package/dist/runner-QW_B2Hqh.js +0 -1
  63. /package/dist/{claudeDefault-B1OdW_1X.js → claudeDefault-BP2oPKZC.js} +0 -0
  64. /package/dist/{gemini-Cc8MC-Lf.js → gemini-2eTblTJ_.js} +0 -0
  65. /package/dist/{sync-BfqO3fnF.js → sync-B6uHJ3Je.js} +0 -0
  66. /package/dist/{types-BIWFx0bF.js → types-BDgDAGpu.js} +0 -0
@@ -1 +1 @@
1
- import{i as e,t}from"./runner-QW_B2Hqh.js";async function n(e){return t(r(e))}function r(e){return e===`codex`?`codex`:e===`gemini`?`gemini`:`claude`}function i(e,t,n){let i=r(e),o=e===`codex`?[`exec`,t]:[`-p`,t];return e===`gemini`&&n.model&&o.unshift(`-m`,n.model),{executable:i,baseArgs:o,yoloArgs:a(e,n.yolo)}}function a(e,t){if(t)switch(e){case`codex`:return[`--dangerously-bypass-approvals-and-sandbox`];case`gemini`:return[`-y`];case`claude`:return[`--dangerously-skip-permissions`]}}async function o(t,n,r){await e(i(t,n,r))}export{r as i,n,o as r,i as t};
1
+ import{a as e,t}from"./runner-DfsWnEWI.js";async function n(e){return t(r(e))}function r(e){return e===`codex`?`codex`:e===`gemini`?`gemini`:`claude`}function i(e,t,n){let i=r(e),o=e===`codex`?[`exec`,t]:[`-p`,t];return e===`gemini`&&n.model&&o.unshift(`-m`,n.model),{executable:i,baseArgs:o,yoloArgs:a(e,n.yolo)}}function a(e,t){if(t)switch(e){case`codex`:return[`--dangerously-bypass-approvals-and-sandbox`];case`gemini`:return[`-y`];case`claude`:return[`--dangerously-skip-permissions`]}}async function o(t,n,r){await e(i(t,n,r))}export{r as i,n,o as r,i as t};
@@ -1 +1 @@
1
- import{n as e,t}from"./runner-QW_B2Hqh.js";var n=class{async validateAvailability(){return t(this.executable)}async getVersion(){try{return await e(this.executable)}catch{return`unknown`}}};export{n as t};
1
+ import{n as e,t}from"./runner-DfsWnEWI.js";var n=class{async validateAvailability(){return t(this.executable)}async getVersion(){try{return await e(this.executable)}catch{return`unknown`}}};export{n as t};
@@ -1 +1 @@
1
- import{t as e}from"./base-Cb8gvSZx.js";import*as t from"node:fs";import*as n from"node:path";import*as r from"node:os";var i=class extends e{toolId=`claude`;executable=`claude`;buildCommandSpec(e){let t=[];if(e.continue?t.push(`-c`):e.resume&&t.push(`-r`),e.settings){let n=this.#e(e.settings);t.push(`--settings`,n)}return{executable:this.executable,baseArgs:t,yoloArgs:e.yolo?[`--dangerously-skip-permissions`]:void 0}}#e(e){if(e.trim().startsWith(`{`)||n.isAbsolute(e)||e.endsWith(`.json`))return e;let i=n.join(r.homedir(),`.claude`),a=n.join(i,`settings.${e}.json`);if(t.existsSync(a))return a;let o=n.join(i,`settings-${e}.json`);return t.existsSync(o)?o:a}};export{i as t};
1
+ import{t as e}from"./base-ES3hc6uu.js";import*as t from"node:fs";import*as n from"node:path";import*as r from"node:os";var i=class extends e{toolId=`claude`;executable=`claude`;buildCommandSpec(e){let t=[];if(e.continue?t.push(`-c`):e.resume&&t.push(`-r`),e.settings){let n=this.#e(e.settings);t.push(`--settings`,n)}return{executable:this.executable,baseArgs:t,yoloArgs:e.yolo?[`--dangerously-skip-permissions`]:void 0}}#e(e){if(e.trim().startsWith(`{`)||n.isAbsolute(e)||e.endsWith(`.json`))return e;let i=n.join(r.homedir(),`.claude`),a=n.join(i,`settings.${e}.json`);if(t.existsSync(a))return a;let o=n.join(i,`settings-${e}.json`);return t.existsSync(o)?o:a}};export{i as t};
@@ -1 +1 @@
1
- import{p as e}from"./errors-x3Es7YJ3.js";import{n as t,t as n}from"./editor-DUx1Sby2.js";import{t as r}from"./format-CZL0rRQR.js";import{a as i,c as a,h as o,m as s,s as c}from"./fsStore-D1omjK0d.js";import{t as l}from"./base-Dv8Ajp1w.js";import{t as u}from"./claudeDefault-B1OdW_1X.js";import*as d from"node:fs";import*as f from"node:path";var p=class extends l{toolId=`claude`;async list(e){let t=s(this.validateAndResolvePath(e)),n=f.dirname(t),r=f.basename(t),i=[this.#e(t,e,!0)];if(d.existsSync(n)){let t=d.readdirSync(n,{withFileTypes:!0});for(let a of t){if(!a.isFile()||a.name===r||!this.#r(a.name))continue;let t=f.join(n,a.name);i.push(this.#e(t,e,!1))}}return{type:`files`,files:this.#i(i)}}resolvePath(e){switch(e){case`user`:return`~/.claude/settings.json`;case`project`:return`.claude/settings.json`;case`local`:return`.claude/settings.local.json`;default:throw Error(`Unsupported scope for Claude: ${e}`)}}validateScope(e){return[`user`,`project`,`local`].includes(e)}async switchProfile(t,n,i){let a=s(this.validateAndResolvePath(t)),o=n.trim();if(!o)throw Error(`Variant name cannot be empty`);let l=c(f.dirname(a),o,a);if(!l)throw new e(o);let u=this.readConfig(l),d={};try{d=this.readConfig(a)}catch{d={}}let p=r(d,u);if(i?.preview)return{success:!0,preview:!0,filePath:a,diff:p??void 0,data:{from:l,to:a,hasChanges:!!p},message:p?`Preview generated. Review diff before applying.`:`Current settings already match the selected variant.`};if(!p)return{success:!0,message:`Current settings already match the selected variant.`,filePath:a};let m=i?.backup??!1;return this.writeConfig(a,u,m),{success:!0,message:`Switched to ${f.basename(l)}`,filePath:a,data:{from:l,to:a}}}async edit(e,r){let a=s(this.validateAndResolvePath(e)),l=f.dirname(a),u=r.name?.trim(),p=t(r.ide);i(l);let m=a,h=`default`;if(u&&u!==``&&u!==`default`){let e=c(l,u,a);if(e)m=e;else if(m=f.join(l,`settings.${u}.json`),!d.existsSync(m)){let e=this.#n(a);o(m,e,!1)}h=u}else if(!d.existsSync(m)){let e=this.#n(a);o(m,e,!1)}return await n(p,m),{success:!0,message:`Opened ${h} settings in ${p}`,filePath:m,data:{variant:h,ide:p}}}#e(e,t,n){let r=a(e);return{filename:f.basename(e),variant:this.#t(e),path:e,scope:t,active:n,exists:!!r,size:r?.size,lastModified:r?.lastModified}}#t(e){let t=f.basename(e),n=t.match(/^settings(?:[._-](.+))?\.json$/);return n?n[1]??`default`:t.replace(/\.json$/,``)}#n(e){try{if(d.existsSync(e)){let t=d.readFileSync(e,`utf-8`);return JSON.parse(t)}}catch{}return{...u}}#r(e){return/^settings[._-].+\.json$/.test(e)}getCurrentVariant(e){let t=s(this.validateAndResolvePath(e)),n=f.dirname(t);if(!d.existsSync(t))return null;let r;try{r=d.readFileSync(t,`utf-8`)}catch{return null}if(!d.existsSync(n))return null;let i=d.readdirSync(n,{withFileTypes:!0});for(let e of i){if(!e.isFile()||!this.#r(e.name))continue;let t=f.join(n,e.name);try{let e=d.readFileSync(t,`utf-8`);if(r===e)return this.#t(t)}catch{continue}}return null}#i(e){return e.sort((e,t)=>e.active&&!t.active?-1:!e.active&&t.active?1:e.variant.localeCompare(t.variant))}};export{p as t};
1
+ import{p as e}from"./errors-x3Es7YJ3.js";import{n as t,t as n}from"./editor-DUx1Sby2.js";import{t as r}from"./format-CZL0rRQR.js";import{a as i,c as a,h as o,m as s,s as c}from"./fsStore-D1omjK0d.js";import{t as l}from"./base-Dv8Ajp1w.js";import{t as u}from"./claudeDefault-BP2oPKZC.js";import*as d from"node:fs";import*as f from"node:path";var p=class extends l{toolId=`claude`;async list(e){let t=s(this.validateAndResolvePath(e)),n=f.dirname(t),r=f.basename(t),i=[this.#e(t,e,!0)];if(d.existsSync(n)){let t=d.readdirSync(n,{withFileTypes:!0});for(let a of t){if(!a.isFile()||a.name===r||!this.#r(a.name))continue;let t=f.join(n,a.name);i.push(this.#e(t,e,!1))}}return{type:`files`,files:this.#o(i)}}resolvePath(e){switch(e){case`user`:return`~/.claude/settings.json`;case`project`:return`.claude/settings.json`;case`local`:return`.claude/settings.local.json`;default:throw Error(`Unsupported scope for Claude: ${e}`)}}validateScope(e){return[`user`,`project`,`local`].includes(e)}async switchProfile(t,n,i){let a=s(this.validateAndResolvePath(t)),o=n.trim();if(!o)throw Error(`Variant name cannot be empty`);let l=c(f.dirname(a),o,a);if(!l)throw new e(o);let u=this.readConfig(l),d={};try{d=this.readConfig(a)}catch{d={}}let p=r(d,u);if(i?.preview)return{success:!0,preview:!0,filePath:a,diff:p??void 0,data:{from:l,to:a,hasChanges:!!p},message:p?`Preview generated. Review diff before applying.`:`Current settings already match the selected variant.`};if(!p)return{success:!0,message:`Current settings already match the selected variant.`,filePath:a};let m=i?.backup??!1;return this.writeConfig(a,u,m),{success:!0,message:`Switched to ${f.basename(l)}`,filePath:a,data:{from:l,to:a}}}async edit(e,r){let a=s(this.validateAndResolvePath(e)),l=f.dirname(a),u=r.name?.trim(),p=t(r.ide);i(l);let m=a,h=`default`;if(u&&u!==``&&u!==`default`){let e=c(l,u,a);if(e)m=e;else if(m=f.join(l,`settings.${u}.json`),!d.existsSync(m)){let e=this.#n(a);o(m,e,!1)}h=u}else if(!d.existsSync(m)){let e=this.#n(a);o(m,e,!1)}return await n(p,m),{success:!0,message:`Opened ${h} settings in ${p}`,filePath:m,data:{variant:h,ide:p}}}#e(e,t,n){let r=a(e);return{filename:f.basename(e),variant:this.#t(e),path:e,scope:t,active:n,exists:!!r,size:r?.size,lastModified:r?.lastModified}}#t(e){let t=f.basename(e),n=t.match(/^settings(?:[._-](.+))?\.json$/);return n?n[1]??`default`:t.replace(/\.json$/,``)}#n(e){try{if(d.existsSync(e)){let t=d.readFileSync(e,`utf-8`);return JSON.parse(t)}}catch{}return{...u}}#r(e){return/^settings[._-].+\.json$/.test(e)}getCurrentVariant(e){let t=s(this.validateAndResolvePath(e)),n=f.dirname(t);if(!d.existsSync(t)||!d.existsSync(n))return null;let r;try{r=this.readConfig(t)}catch{return null}let i=d.readdirSync(n,{withFileTypes:!0});for(let e of i){if(!e.isFile()||!this.#r(e.name))continue;let t=f.join(n,e.name);try{let e=this.readConfig(t);if(this.#i(r,e))return this.#t(t)}catch{continue}}return null}#i(e,t){return this.#a(e)===this.#a(t)}#a(e){return typeof e!=`object`||!e?JSON.stringify(e):Array.isArray(e)?`[`+e.map(e=>this.#a(e)).join(`,`)+`]`:`{`+Object.keys(e).sort().map(t=>JSON.stringify(t)+`:`+this.#a(e[t])).join(`,`)+`}`}#o(e){return e.sort((e,t)=>e.active&&!t.active?-1:!e.active&&t.active?1:e.variant.localeCompare(t.variant))}};export{p as t};
@@ -1 +1 @@
1
- import{t as e}from"./base-Cb8gvSZx.js";var t=class extends e{toolId=`codex`;executable=`codex`;buildCommandSpec(e){let t=[];if(e.settings){let n=this.#e(e.settings);t.push(...n)}return e.continue?t.push(`resume`,`--last`):e.resume&&t.push(`resume`),{executable:this.executable,baseArgs:t,yoloArgs:e.yolo?[`--dangerously-bypass-approvals-and-sandbox`]:void 0}}#e(e){let t=[];if(e.includes(`=`)){let n=e.split(`;`).map(e=>e.trim());for(let e of n)e&&t.push(`-c`,e)}else t.push(`-c`,`model=${e}`);return t}};export{t};
1
+ import{t as e}from"./base-ES3hc6uu.js";var t=class extends e{toolId=`codex`;executable=`codex`;buildCommandSpec(e){let t=[];if(e.settings){let n=this.#e(e.settings);t.push(...n)}return e.continue?t.push(`resume`,`--last`):e.resume&&t.push(`resume`),{executable:this.executable,baseArgs:t,yoloArgs:e.yolo?[`--dangerously-bypass-approvals-and-sandbox`]:void 0}}#e(e){let t=[];if(e.includes(`=`)){let n=e.split(`;`).map(e=>e.trim());for(let e of n)e&&t.push(`-c`,e)}else t.push(`-c`,`model=${e}`);return t}};export{t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./errors-x3Es7YJ3.js";import{n as t,t as n}from"./editor-DUx1Sby2.js";import{a as r,c as i,f as a,g as o,l as s,m as c,o as l,p as u,r as d,t as f}from"./fsStore-D1omjK0d.js";import{t as p}from"./base-Dv8Ajp1w.js";import*as m from"node:path";const h=`~/.codex/auth-profiles`,g=`~/.codex/auth.json`;var _=class extends p{toolId=`codex`;async list(e){let t=this.validateAndResolvePath(e),n=this.readConfig(t),r=this.#c(n),i=this.listAuthProfiles(),a=l(g),o=typeof n.current_auth_profile==`string`?n.current_auth_profile:a||i.length>0?this.#d():null;return{type:`entries`,entries:{current_provider:typeof n.model_provider==`string`?n.model_provider:null,current_profile:typeof n.current_profile==`string`?n.current_profile:null,current_auth_profile:o,providers:r,auth_profiles:i},filePath:t}}async inspect(e,t){let n=this.validateAndResolvePath(e),r=c(n),a=l(n),o=a?this.#s(n):{},s=a?i(n):null,u=t?.trim();if(u){if(this.isAuthProfile(u)){let e=`${h}/${u}.json`,t=this.#u(e),n=i(e);return{path:c(e),exists:l(e),content:JSON.stringify({mode:`auth`,authProfile:u,authFile:c(e),configFile:r,authData:t},null,2),size:n?.size,lastModified:n?.lastModified}}let e=v(o.model_providers)?o.model_providers:{};if(e[u])return{path:r,exists:a,content:JSON.stringify({mode:`provider`,currentProvider:u,config:e[u]??{}},null,2),size:s?.size,lastModified:s?.lastModified};let t=v(o.profiles)?o.profiles:{};return t[u]?{path:r,exists:a,content:JSON.stringify({mode:`profile`,currentProfile:u,config:t[u]??{}},null,2),size:s?.size,lastModified:s?.lastModified}:{path:r,exists:a,content:JSON.stringify({mode:`not_found`,requested:u,availableProviders:Object.keys(e),availableProfiles:Object.keys(t),availableAuthProfiles:this.listAuthProfiles()},null,2),size:s?.size,lastModified:s?.lastModified}}if(!a)return this.#e(r);if(o.current_profile&&typeof o.current_profile==`string`)return this.#t(o,r,s);if(o.model_provider&&typeof o.model_provider==`string`)return this.#n(o,r,s);let d=typeof o.current_auth_profile==`string`?o.current_auth_profile:null;return d||l(g)?this.#r(d,r,s):this.#i(r,s)}#e(e){if(l(g)){let e=this.#l(),t=this.#d();return{path:c(g),exists:!0,content:JSON.stringify({mode:`auth`,currentAuthProfile:t,authFile:c(g),authData:e},null,2)}}return{path:e,exists:!1}}#t(e,t,n){let r=e.current_profile,i=(v(e.profiles)?e.profiles:{})[r];return{path:t,exists:!0,content:JSON.stringify({mode:`profile`,currentProfile:r,config:v(i)?i:{}},null,2),size:n?.size,lastModified:n?.lastModified}}#n(e,t,n){let r=e.model_provider,i=(v(e.model_providers)?e.model_providers:{})[r];return{path:t,exists:!0,content:JSON.stringify({mode:`provider`,currentProvider:r,config:v(i)?i:{}},null,2),size:n?.size,lastModified:n?.lastModified}}#r(e,t,n){let r=this.#l(),i=e||this.#d();return{path:c(g),exists:!0,content:JSON.stringify({mode:`auth`,currentAuthProfile:i,authFile:c(g),configFile:t,authData:r},null,2),size:n?.size,lastModified:n?.lastModified}}#i(e,t){return{path:e,exists:!0,content:JSON.stringify({mode:`none`,message:`No active provider or auth configured. Run 'codex login' or configure a model_provider.`,configFile:e},null,2),size:t?.size,lastModified:t?.lastModified}}resolvePath(e){switch(e){case`user`:return`~/.codex/config.toml`;default:throw Error(`Unsupported scope for Codex: ${e}`)}}validateScope(e){return e===`user`}async switchProfile(e,t,n){return this.validateAndResolvePath(e),this.isAuthProfile(t)?this.#a(t):this.#o(e,t)}async edit(e,i){let a=this.validateAndResolvePath(e);if(!i.provider){let e=c(a);r(m.dirname(e)),l(a)||this.writeConfig(a,{});let o=t(i.ide);return await n(o,e),{success:!0,message:`Opened Codex config in ${o}`,filePath:e}}let o=i.provider.id?.trim()||i.provider.name?.trim();if(!o)throw Error(`Provider name cannot be empty`);let s=i.provider.base_url?.trim();if(!s)throw Error(`Base URL is required for Codex providers`);let u=i.provider.name?.trim()||o,d=i.provider.experimental_bearer_token?.trim();if(!d)throw Error(`Experimental bearer token is required for Codex providers`);let f=this.#s(a),p=v(f.model_providers)?{...f.model_providers}:{};p[o]={name:u,base_url:s,wire_api:`responses`,experimental_bearer_token:d};let h={...f,model_providers:p};return this.writeConfig(a,h),{success:!0,message:`Added model_providers.${o}`,filePath:c(a),data:p[o]}}listAuthProfiles(){return s(h).filter(e=>e.endsWith(`.json`)).map(e=>e.replace(`.json`,``))}isAuthProfile(e){return l(`${h}/${e}.json`)}saveAuthProfile(e,t=!1){let n=`${h}/${e}.json`;return l(g)?!t&&l(n)?{success:!1,message:`Profile "${e}" already exists. Use --force to overwrite.`}:(r(h),f(g,n),d(g),{success:!0,message:`Saved current auth as profile: ${e}\nauth.json has been removed. You can now login with another account.`,filePath:c(n)}):{success:!1,message:`No auth.json found. Please run 'codex login' first.`}}deleteAuthProfile(e){let t=`${h}/${e}.json`;return l(t)?(d(t),{success:!0,message:`Deleted auth profile: ${e}`}):{success:!1,message:`Auth profile "${e}" not found.`}}getAllSwitchableProfiles(e){let t=this.resolvePath(e),n=[];try{let e=this.readConfig(t),r=e.model_providers;v(r)&&(n=Object.keys(r));let i=e.profiles;v(i)&&(n=[...new Set([...n,...Object.keys(i)])])}catch{}let r=this.listAuthProfiles();return{providers:n,authProfiles:r}}#a(e){let t=`${h}/${e}.json`,n=`~/.codex/config.toml`;if(!l(t))return{success:!1,message:`Auth profile "${e}" not found.`};f(t,g);try{let t=this.#s(n);delete t.model_provider,delete t.current_profile,t.current_auth_profile=e,this.writeConfig(n,t)}catch{this.writeConfig(n,{current_auth_profile:e})}return{success:!0,message:`Switched to auth profile: ${e}`,filePath:c(g)}}#o(e,t){let n=this.resolvePath(e);l(g)&&d(g);let r=this.#s(n);delete r.current_auth_profile;let i=r.profiles,a=(v(i)?i:void 0)?.[t];if(v(a)){let e={...r};for(let[t,n]of Object.entries(a))e[t]=n;return e.current_profile=t,delete e.model_provider,this.writeConfig(n,e),{success:!0,message:`Switched to profile: ${t}`,filePath:c(n)}}delete r.current_profile;let o={...r,model_provider:t};return this.writeConfig(n,o),{success:!0,message:`Switched to provider: ${t}`,filePath:c(n)}}readConfig(e){return u(e)}writeConfig(e,t){o(e,t,!1)}#s(t){try{return this.readConfig(t)}catch(t){if(t instanceof e)return{};throw t}}#c(e){let t=e.model_providers;return v(t)?t:{}}#l(){if(!l(g))return null;try{return a(g)}catch{return null}}#u(e){if(!l(e))return null;try{return a(e)}catch{return null}}#d(){if(!l(g))return`default`;let e;try{e=a(g)}catch{return`default`}if(!e)return`default`;let t=this.listAuthProfiles();for(let n of t){let t=`${h}/${n}.json`;try{let r=a(t);if(this.#f(e,r))return n}catch{continue}}return`default`}#f(e,t){return this.#p(e)===this.#p(t)}#p(e){return typeof e!=`object`||!e?JSON.stringify(e):Array.isArray(e)?`[`+e.map(e=>this.#p(e)).join(`,`)+`]`:`{`+Object.keys(e).sort().map(t=>JSON.stringify(t)+`:`+this.#p(e[t])).join(`,`)+`}`}};const v=e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&!(e instanceof Date);export{v as n,_ as t};
@@ -1,4 +1,4 @@
1
- import{t as e}from"../../git-DrTSFbmV.js";import"../../validators-kRNHvOZQ.js";import"../../errors-x3Es7YJ3.js";import"../../runner-QW_B2Hqh.js";import"../../utils-DugkWRYo.js";import"../../pr-BNviK79Q.js";import"../../view-zF4lc17m.js";import"../../worktree-CrkzOfkB.js";import"../../create-C3P6UYhE.js";import{t}from"../../dispatcher-CPtFZ27f.js";import{Command as n,Flags as r}from"@oclif/core";var i=class i extends n{static summary=`Create a pull request (PR Create)`;static description=`
1
+ import{t as e}from"../../git-DrTSFbmV.js";import"../../validators-kRNHvOZQ.js";import"../../errors-x3Es7YJ3.js";import"../../runner-DfsWnEWI.js";import"../../utils-7jommWkE.js";import"../../pr-B-Wvra01.js";import"../../view-D96BK69H.js";import"../../worktree-D9lv01RB.js";import"../../create-CoP40LJP.js";import{t}from"../../dispatcher-gwnQwr6V.js";import{Command as n,Flags as r}from"@oclif/core";var i=class i extends n{static summary=`Create a pull request (PR Create)`;static description=`
2
2
  Create a pull request using GitHub CLI.
3
3
  Supports automatic browser preview with customizable browser selection.
4
4
  `;static examples=[{description:`Create PR interactively`,command:`<%= config.bin %> <%= command.id %>`},{description:`Create PR with title and body`,command:`<%= config.bin %> <%= command.id %> --title "Feature X" --body "Implements feature X"`},{description:`Create PR and open in browser`,command:`<%= config.bin %> <%= command.id %> --web`},{description:`Create PR and preview in Safari`,command:`<%= config.bin %> <%= command.id %> --web --browser safari`},{description:`Create draft PR`,command:`<%= config.bin %> <%= command.id %> --draft --title "WIP: Feature X"`},{description:`Create PR with reviewers and labels`,command:`<%= config.bin %> <%= command.id %> --reviewer user1 --reviewer user2 --label bug --label urgent`}];static flags={title:r.string({char:`t`,description:`PR title`}),body:r.string({char:`b`,description:`PR body/description`}),base:r.string({description:`Base branch (default: repository default branch)`}),head:r.string({description:`Head branch (default: current branch)`}),draft:r.boolean({char:`d`,description:`Create as draft PR`,default:!1}),web:r.boolean({char:`w`,description:`Open PR in browser after creation`,default:!1}),browser:r.string({description:`Browser to use when --web is enabled`,options:[...e],default:`chrome`}),assignee:r.string({char:`a`,description:`Assign user(s) (can be used multiple times)`,multiple:!0}),reviewer:r.string({char:`r`,description:`Request reviewer(s) (can be used multiple times)`,multiple:!0}),label:r.string({char:`l`,description:`Add label(s) (can be used multiple times)`,multiple:!0})};async run(){let{flags:e}=await this.parse(i),n=new t,r={title:e.title,body:e.body,base:e.base,head:e.head,draft:e.draft,web:e.web,browser:e.browser,assignee:e.assignee,reviewer:e.reviewer,label:e.label};try{let e=await n.execute({command:`prc`,cwd:process.cwd(),data:r});this.log(`✓ ${e.message}`),e.details?.draft&&this.log(` Type: Draft PR`),e.details?.base&&this.log(` Base: ${e.details.base}`),e.details?.head&&this.log(` Head: ${e.details.head}`)}catch(e){this.error(e.message,{exit:1})}}};export{i as default};
@@ -1,4 +1,4 @@
1
- import"../../validators-kRNHvOZQ.js";import"../../errors-x3Es7YJ3.js";import"../../runner-QW_B2Hqh.js";import"../../utils-DugkWRYo.js";import"../../pr-BNviK79Q.js";import"../../view-zF4lc17m.js";import"../../worktree-CrkzOfkB.js";import"../../create-C3P6UYhE.js";import{t as e}from"../../dispatcher-CPtFZ27f.js";import{Args as t,Command as n,Flags as r}from"@oclif/core";var i=class i extends n{static summary=`Checkout a PR branch (PR Read/Retrieve)`;static description=`
1
+ import"../../validators-kRNHvOZQ.js";import"../../errors-x3Es7YJ3.js";import"../../runner-DfsWnEWI.js";import"../../utils-7jommWkE.js";import"../../pr-B-Wvra01.js";import"../../view-D96BK69H.js";import"../../worktree-D9lv01RB.js";import"../../create-CoP40LJP.js";import{t as e}from"../../dispatcher-gwnQwr6V.js";import{Args as t,Command as n,Flags as r}from"@oclif/core";var i=class i extends n{static summary=`Checkout a PR branch (PR Read/Retrieve)`;static description=`
2
2
  Checkout a pull request branch using GitHub CLI (gh) or git fallback.
3
3
  Automatically detects gh availability and falls back to git fetch if needed.
4
4
  `;static examples=[{description:`Checkout PR using gh or git fallback`,command:`<%= config.bin %> <%= command.id %> 123`},{description:`Checkout PR to specific branch`,command:`<%= config.bin %> <%= command.id %> 456 --branch my-pr-branch`},{description:`Force git fallback with custom remote`,command:`<%= config.bin %> <%= command.id %> 789 --no-gh --remote upstream`},{description:`Checkout a PR from another repo (owner:repo#id)`,command:`<%= config.bin %> <%= command.id %> octo/demo-repo#321 --branch demo-pr`}];static args={id:t.string({description:`PR number or owner:repo#123 format`,required:!0})};static flags={branch:r.string({char:`b`,description:`Branch name (default: pr/<id>)`}),remote:r.string({char:`r`,description:`Remote name`,default:`origin`}),"no-gh":r.boolean({description:`Skip GitHub CLI, use git directly`,default:!1})};async run(){let{args:t,flags:n}=await this.parse(i),r=new e,a={id:t.id,branch:n.branch,strategy:n[`no-gh`]?`git`:`gh`,remote:n.remote};try{let e=await r.execute({command:`prr`,cwd:process.cwd(),data:a});this.log(`✓ ${e.message}`),e.details&&(this.log(` Strategy: ${e.details.strategy}`),this.log(` Branch: ${e.details.branch}`))}catch(e){this.error(e.message,{exit:1})}}};export{i as default};
@@ -1,4 +1,4 @@
1
- import{t as e}from"../../git-DrTSFbmV.js";import"../../validators-kRNHvOZQ.js";import"../../errors-x3Es7YJ3.js";import"../../runner-QW_B2Hqh.js";import"../../utils-DugkWRYo.js";import"../../pr-BNviK79Q.js";import"../../view-zF4lc17m.js";import"../../worktree-CrkzOfkB.js";import"../../create-C3P6UYhE.js";import{t}from"../../dispatcher-CPtFZ27f.js";import{Args as n,Command as r,Flags as i}from"@oclif/core";var a=class a extends r{static summary=`Open PR in web browser (PR View)`;static description=`
1
+ import{t as e}from"../../git-DrTSFbmV.js";import"../../validators-kRNHvOZQ.js";import"../../errors-x3Es7YJ3.js";import"../../runner-DfsWnEWI.js";import"../../utils-7jommWkE.js";import"../../pr-B-Wvra01.js";import"../../view-D96BK69H.js";import"../../worktree-D9lv01RB.js";import"../../create-CoP40LJP.js";import{t}from"../../dispatcher-gwnQwr6V.js";import{Args as n,Command as r,Flags as i}from"@oclif/core";var a=class a extends r{static summary=`Open PR in web browser (PR View)`;static description=`
2
2
  Open a pull request in your web browser using GitHub CLI.
3
3
  Supports multiple browsers: Chrome (default), Safari, Firefox, Arc, Edge, Dia.
4
4
  `;static examples=[{description:`Open PR in Chrome (default)`,command:`<%= config.bin %> <%= command.id %> 123`},{description:`Open PR in Safari`,command:`<%= config.bin %> <%= command.id %> 456 --browser safari`},{description:`Open PR in Firefox`,command:`<%= config.bin %> <%= command.id %> 789 --browser firefox`},{description:`Open PR in Arc`,command:`<%= config.bin %> <%= command.id %> 999 --browser arc`},{description:`Open a PR from another repo in Edge`,command:`<%= config.bin %> <%= command.id %> octo/demo-repo#42 --browser edge`}];static args={id:n.string({description:`PR number`,required:!0})};static flags={browser:i.string({char:`b`,description:`Browser to use`,options:[...e],default:`chrome`})};async run(){let{args:e,flags:n}=await this.parse(a),r=new t,i={id:e.id,browser:n.browser};try{let e=await r.execute({command:`prv`,cwd:process.cwd(),data:i});this.log(`✓ ${e.message}`)}catch(e){this.error(e.message,{exit:1})}}};export{a as default};
@@ -1,4 +1,4 @@
1
- import"../../validators-kRNHvOZQ.js";import"../../errors-x3Es7YJ3.js";import"../../runner-QW_B2Hqh.js";import"../../utils-DugkWRYo.js";import"../../pr-BNviK79Q.js";import"../../view-zF4lc17m.js";import"../../worktree-CrkzOfkB.js";import"../../create-C3P6UYhE.js";import{t as e}from"../../dispatcher-CPtFZ27f.js";import{Command as t,Flags as n}from"@oclif/core";var r=class r extends t{static summary=`Manage git worktrees`;static description=`
1
+ import"../../validators-kRNHvOZQ.js";import"../../errors-x3Es7YJ3.js";import"../../runner-DfsWnEWI.js";import"../../utils-7jommWkE.js";import"../../pr-B-Wvra01.js";import"../../view-D96BK69H.js";import"../../worktree-D9lv01RB.js";import"../../create-CoP40LJP.js";import{t as e}from"../../dispatcher-gwnQwr6V.js";import{Command as t,Flags as n}from"@oclif/core";var r=class r extends t{static summary=`Manage git worktrees`;static description=`
2
2
  Manage git worktrees: list existing worktrees, add new ones, remove, or prune stale entries.
3
3
  Git worktrees allow multiple working directories from a single repository.
4
4
  `;static examples=[{description:`List all worktrees in friendly format`,command:`<%= config.bin %> <%= command.id %> --list`},{description:`Add new worktree with auto-generated path`,command:`<%= config.bin %> <%= command.id %> --add --branch feature/login`},{description:`Add worktree with custom path`,command:`<%= config.bin %> <%= command.id %> -a -p ../repo-feature -b feature/login`},{description:`Switch to main worktree (outputs path for cd)`,command:`cd $(<%= config.bin %> <%= command.id %> -s)`},{description:`Switch to specific worktree by branch name`,command:`cd $(<%= config.bin %> <%= command.id %> -s -b feature/login)`},{description:`Remove worktree by branch name`,command:`<%= config.bin %> <%= command.id %> -r -b main`},{description:`Remove worktree by directory name`,command:`<%= config.bin %> <%= command.id %> -r -b xling-feature`},{description:`Remove worktree by path`,command:`<%= config.bin %> <%= command.id %> -r -p ../repo-feature`},{description:`Prune stale worktrees`,command:`<%= config.bin %> <%= command.id %> --prune`}];static flags={list:n.boolean({char:`l`,description:`List worktrees (default)`,default:!1}),add:n.boolean({char:`a`,description:`Add new worktree (auto-generates path if not specified)`,default:!1}),switch:n.boolean({char:`s`,description:`Get worktree path (outputs path only, use with: cd $(xling git:worktree -s -b <branch>))`,default:!1}),remove:n.boolean({char:`r`,description:`Remove worktree`,default:!1}),prune:n.boolean({description:`Prune stale worktrees`,default:!1}),path:n.string({char:`p`,description:`Worktree path (e.g., '../repo-feature' or absolute path). Auto-generated if not specified with --add.`}),branch:n.string({char:`b`,description:`Branch or worktree name. Defaults to main for --add and --switch. For --remove, intelligently matches branch or directory name.`}),force:n.boolean({char:`f`,description:`Force operation`,default:!1}),detach:n.boolean({description:`Detach HEAD in new worktree`,default:!1})};async run(){let{flags:t}=await this.parse(r),n=`list`;t.add?n=`add`:t.switch?n=`switch`:t.remove?n=`remove`:t.prune&&(n=`prune`);let i=new e,a={action:n,path:t.path,branch:t.branch,force:t.force,detach:t.detach};try{let e=await i.execute({command:`worktree`,cwd:process.cwd(),data:a});if(n===`switch`){this.log(e.message);return}this.log(`✓ ${e.message}`),e.details?.output&&this.log(`
@@ -1,4 +1,4 @@
1
- import"../../validators-kRNHvOZQ.js";import"../../errors-x3Es7YJ3.js";import"../../runner-QW_B2Hqh.js";import"../../utils-DugkWRYo.js";import"../../pr-BNviK79Q.js";import"../../view-zF4lc17m.js";import"../../worktree-CrkzOfkB.js";import"../../create-C3P6UYhE.js";import{t as e}from"../../dispatcher-CPtFZ27f.js";import{Command as t,Flags as n}from"@oclif/core";var r=class r extends t{static summary=`Add a new git worktree`;static description=`
1
+ import"../../validators-kRNHvOZQ.js";import"../../errors-x3Es7YJ3.js";import"../../runner-DfsWnEWI.js";import"../../utils-7jommWkE.js";import"../../pr-B-Wvra01.js";import"../../view-D96BK69H.js";import"../../worktree-D9lv01RB.js";import"../../create-CoP40LJP.js";import{t as e}from"../../dispatcher-gwnQwr6V.js";import{Command as t,Flags as n}from"@oclif/core";var r=class r extends t{static summary=`Add a new git worktree`;static description=`
2
2
  Create a new git worktree with automatic path generation.
3
3
  Defaults to main branch if not specified.
4
4
  Use --select to choose a branch from an interactive list.
@@ -1,4 +1,4 @@
1
- import"../../validators-kRNHvOZQ.js";import"../../errors-x3Es7YJ3.js";import"../../runner-QW_B2Hqh.js";import"../../utils-DugkWRYo.js";import"../../pr-BNviK79Q.js";import"../../view-zF4lc17m.js";import"../../worktree-CrkzOfkB.js";import"../../create-C3P6UYhE.js";import{t as e}from"../../dispatcher-CPtFZ27f.js";import{Command as t}from"@oclif/core";var n=class extends t{static summary=`List git worktrees`;static description=`
1
+ import"../../validators-kRNHvOZQ.js";import"../../errors-x3Es7YJ3.js";import"../../runner-DfsWnEWI.js";import"../../utils-7jommWkE.js";import"../../pr-B-Wvra01.js";import"../../view-D96BK69H.js";import"../../worktree-D9lv01RB.js";import"../../create-CoP40LJP.js";import{t as e}from"../../dispatcher-gwnQwr6V.js";import{Command as t}from"@oclif/core";var n=class extends t{static summary=`List git worktrees`;static description=`
2
2
  List all git worktrees in a friendly format.
3
3
  Shows the path and branch for each worktree.
4
4
  `;static examples=[{description:`List all worktrees`,command:`<%= config.bin %> <%= command.id %>`},{description:`List worktrees and filter for feature branches`,command:`<%= config.bin %> <%= command.id %> | grep feature/`},{description:`List worktrees from another repo directory`,command:`cd ~/projects/my-repo && <%= config.bin %> <%= command.id %>`}];async run(){let t=new e,n={action:`list`};try{let e=await t.execute({command:`worktree`,cwd:process.cwd(),data:n});this.log(`✓ ${e.message}`),e.details?.output&&this.log(`
@@ -1,4 +1,4 @@
1
- import"../../validators-kRNHvOZQ.js";import"../../errors-x3Es7YJ3.js";import"../../runner-QW_B2Hqh.js";import"../../utils-DugkWRYo.js";import"../../pr-BNviK79Q.js";import"../../view-zF4lc17m.js";import"../../worktree-CrkzOfkB.js";import"../../create-C3P6UYhE.js";import{t as e}from"../../dispatcher-CPtFZ27f.js";import{Command as t}from"@oclif/core";var n=class extends t{static summary=`Prune stale git worktrees`;static description=`
1
+ import"../../validators-kRNHvOZQ.js";import"../../errors-x3Es7YJ3.js";import"../../runner-DfsWnEWI.js";import"../../utils-7jommWkE.js";import"../../pr-B-Wvra01.js";import"../../view-D96BK69H.js";import"../../worktree-D9lv01RB.js";import"../../create-CoP40LJP.js";import{t as e}from"../../dispatcher-gwnQwr6V.js";import{Command as t}from"@oclif/core";var n=class extends t{static summary=`Prune stale git worktrees`;static description=`
2
2
  Remove stale worktree administrative files.
3
3
  This cleans up worktrees that have been manually deleted from the filesystem.
4
4
  `;static examples=[{description:`Prune stale worktrees`,command:`<%= config.bin %> <%= command.id %>`},{description:`Clean up after manually deleting a worktree folder`,command:`cd ~/repo && <%= config.bin %> <%= command.id %>`},{description:`Prune then list worktrees to verify`,command:`<%= config.bin %> <%= command.id %> && <%= config.bin %> git:wtl`}];async run(){let t=new e,n={action:`prune`};try{let e=await t.execute({command:`worktree`,cwd:process.cwd(),data:n});this.log(`✓ ${e.message}`),e.details?.output&&this.log(`
@@ -1,4 +1,4 @@
1
- import"../../validators-kRNHvOZQ.js";import"../../errors-x3Es7YJ3.js";import"../../runner-QW_B2Hqh.js";import"../../utils-DugkWRYo.js";import"../../pr-BNviK79Q.js";import"../../view-zF4lc17m.js";import"../../worktree-CrkzOfkB.js";import"../../create-C3P6UYhE.js";import{t as e}from"../../dispatcher-CPtFZ27f.js";import{Command as t,Flags as n}from"@oclif/core";var r=class r extends t{static summary=`Remove a git worktree`;static description=`
1
+ import"../../validators-kRNHvOZQ.js";import"../../errors-x3Es7YJ3.js";import"../../runner-DfsWnEWI.js";import"../../utils-7jommWkE.js";import"../../pr-B-Wvra01.js";import"../../view-D96BK69H.js";import"../../worktree-D9lv01RB.js";import"../../create-CoP40LJP.js";import{t as e}from"../../dispatcher-gwnQwr6V.js";import{Command as t,Flags as n}from"@oclif/core";var r=class r extends t{static summary=`Remove a git worktree`;static description=`
2
2
  Remove a git worktree by branch name, directory name, or path.
3
3
  Intelligently matches branch or directory names.
4
4
  Use --select to pick which worktree to remove from an interactive list.
@@ -1,4 +1,4 @@
1
- import"../../validators-kRNHvOZQ.js";import"../../errors-x3Es7YJ3.js";import"../../runner-QW_B2Hqh.js";import"../../utils-DugkWRYo.js";import"../../pr-BNviK79Q.js";import"../../view-zF4lc17m.js";import"../../worktree-CrkzOfkB.js";import"../../create-C3P6UYhE.js";import{t as e}from"../../dispatcher-CPtFZ27f.js";import{Command as t,Flags as n}from"@oclif/core";import{spawn as r}from"node:child_process";var i=class i extends t{static summary=`Switch to a git worktree (opens subshell by default)`;static description=`
1
+ import"../../validators-kRNHvOZQ.js";import"../../errors-x3Es7YJ3.js";import"../../runner-DfsWnEWI.js";import"../../utils-7jommWkE.js";import"../../pr-B-Wvra01.js";import"../../view-D96BK69H.js";import"../../worktree-D9lv01RB.js";import"../../create-CoP40LJP.js";import{t as e}from"../../dispatcher-gwnQwr6V.js";import{Command as t,Flags as n}from"@oclif/core";import{spawn as r}from"node:child_process";var i=class i extends t{static summary=`Switch to a git worktree (opens subshell by default)`;static description=`
2
2
  Find a matching worktree, then start a subshell rooted there.
3
3
  Defaults to the main branch if no branch/directory is provided.
4
4
  Use --path-only for scripting (outputs the path for cd $(...)).
@@ -1,4 +1,4 @@
1
- import"../../errors-x3Es7YJ3.js";import"../../editor-DUx1Sby2.js";import"../../runner-QW_B2Hqh.js";import"../../config-D0b5Ceh4.js";import"../../fsStore-D1omjK0d.js";import"../../base-Dv8Ajp1w.js";import"../../template-DtJFiC8I.js";import{t as e}from"../../xling-DxPgM9hF.js";import"../../providerRegistry-Cioo_VTs.js";import"../../client-BklkqGNW.js";import{n as t,t as n}from"../../types-CDh8FKyF.js";import"../../loadBalancer-DNwUsuJG.js";import"../../errorClassifier-mZXKjKvv.js";import{n as r}from"../../router-DfJrwCH_.js";import{t as i}from"../../prompt-builder-CPDeJ-iv.js";import{i as a,n as o,r as s}from"../../backend-router-aOcWH4J_.js";import{n as c,r as l,t as u}from"../../interactive-mode-CeP7yLWk.js";import{Args as d,Command as f,Flags as p}from"@oclif/core";import*as m from"node:fs";var h=class h extends f{static summary=`Execute prompts via xling router or AI CLI tools`;static description=`
1
+ import"../../errors-x3Es7YJ3.js";import"../../editor-DUx1Sby2.js";import"../../runner-DfsWnEWI.js";import"../../config-D0b5Ceh4.js";import"../../fsStore-D1omjK0d.js";import"../../base-Dv8Ajp1w.js";import"../../template-DtJFiC8I.js";import{t as e}from"../../xling-DxPgM9hF.js";import"../../providerRegistry-Cioo_VTs.js";import"../../client-BklkqGNW.js";import{n as t,t as n}from"../../types-CDh8FKyF.js";import"../../loadBalancer-DNwUsuJG.js";import"../../errorClassifier-mZXKjKvv.js";import{n as r}from"../../router-DfJrwCH_.js";import{t as i}from"../../prompt-builder-CPDeJ-iv.js";import{i as a,n as o,r as s}from"../../backend-router-BVglKdTL.js";import{n as c,r as l,t as u}from"../../interactive-mode-CeP7yLWk.js";import{Args as d,Command as f,Flags as p}from"@oclif/core";import*as m from"node:fs";var h=class h extends f{static summary=`Execute prompts via xling router or AI CLI tools`;static description=`
2
2
  Send prompts to AI models using xling's built-in router (default) or
3
3
  delegate to CLI tools like codex exec, claude -p, or gemini.
4
4
 
@@ -1,4 +1,4 @@
1
- import"../../errors-x3Es7YJ3.js";import"../../editor-DUx1Sby2.js";import{r as e}from"../../format-CZL0rRQR.js";import"../../fsStore-D1omjK0d.js";import"../../base-Dv8Ajp1w.js";import{t}from"../../codex-B8t10wtW.js";import{Command as n,Flags as r}from"@oclif/core";var i=class i extends n{static summary=`Manage saved auth profiles`;static description=`
1
+ import"../../errors-x3Es7YJ3.js";import"../../editor-DUx1Sby2.js";import{r as e}from"../../format-CZL0rRQR.js";import"../../fsStore-D1omjK0d.js";import"../../base-Dv8Ajp1w.js";import{t}from"../../codex-Kk3Sv7uC.js";import{Command as n,Flags as r}from"@oclif/core";var i=class i extends n{static summary=`Manage saved auth profiles`;static description=`
2
2
  Save, list, and delete auth profiles for Codex.
3
3
  Use settings:switch to switch between auth profiles and providers.
4
4
 
@@ -1,4 +1,4 @@
1
- import"../../errors-x3Es7YJ3.js";import"../../editor-DUx1Sby2.js";import{r as e}from"../../format-CZL0rRQR.js";import"../../config-D0b5Ceh4.js";import{m as t,s as n}from"../../fsStore-D1omjK0d.js";import"../../base-Dv8Ajp1w.js";import"../../template-DtJFiC8I.js";import"../../xling-DxPgM9hF.js";import"../../codex-B8t10wtW.js";import"../../claudeDefault-B1OdW_1X.js";import{t as r}from"../../claude-BOK95KeO.js";import"../../gemini-Cc8MC-Lf.js";import{t as i}from"../../dispatcher-CIOJuMxR.js";import{Args as a,Command as o,Flags as s}from"@oclif/core";import c from"node:fs";import l from"node:path";var u=class u extends o{static summary=`View configuration file contents`;static description=`
1
+ import"../../errors-x3Es7YJ3.js";import"../../editor-DUx1Sby2.js";import{r as e}from"../../format-CZL0rRQR.js";import"../../config-D0b5Ceh4.js";import{m as t,s as n}from"../../fsStore-D1omjK0d.js";import"../../base-Dv8Ajp1w.js";import"../../template-DtJFiC8I.js";import"../../xling-DxPgM9hF.js";import"../../codex-Kk3Sv7uC.js";import"../../claudeDefault-BP2oPKZC.js";import{t as r}from"../../claude-BqDhM0_U.js";import"../../gemini-2eTblTJ_.js";import{t as i}from"../../dispatcher-DOZzJY8q.js";import{Args as a,Command as o,Flags as s}from"@oclif/core";import c from"node:fs";import l from"node:path";var u=class u extends o{static summary=`View configuration file contents`;static description=`
2
2
  Print the entire configuration file for the selected tool/scope.
3
3
  Output format depends on the file type (JSON, TOML, etc.).
4
4
  `;static examples=[{description:`Print Claude user settings (raw file)`,command:`<%= config.bin %> <%= command.id %> --tool claude --scope user`},{description:`Inspect a Claude variant by name`,command:`<%= config.bin %> <%= command.id %> hxi --tool claude --scope user`},{description:`Dump Codex config as JSON for scripting`,command:`<%= config.bin %> <%= command.id %> --tool codex --json`},{description:`View xling prompt router config (if present)`,command:`<%= config.bin %> <%= command.id %> --tool xling --scope user`}];static args={name:a.string({description:`Claude variant name (optional). Example: settings:get hxi`,required:!1})};static flags={tool:s.string({char:`t`,description:`AI CLI tool to manage`,options:[`claude`,`codex`,`gemini`,`xling`],default:`claude`}),scope:s.string({char:`s`,description:`Configuration scope`,options:[`user`,`project`,`local`,`system`],default:`user`})};async run(){let{args:t,flags:n}=await this.parse(u);try{let r=n.tool,i=n.scope,a=r===`claude`&&t.name?await this.#t(i,t.name):await this.#e(r,i,t.name);if(n.json){this.log(e({success:!0,data:a}));return}if(!a.exists){this.warn(`Config file not found: ${a.path}`);return}a.content?this.log(a.content):this.log(`File is empty.`)}catch(e){this.error(e.message,{exit:1})}}async#e(e,t,n){return(await new i().execute({tool:e,scope:t,action:`inspect`,name:n})).data}async#t(e,i){let a=new r;if(!a.validateScope(e))throw Error(`Invalid scope for Claude: ${e}`);let o=i.trim();if(!o||o===`default`)return this.#e(`claude`,e);let s=t(a.resolvePath(e)),u=l.dirname(s),d=n(u,o)??l.join(u,`settings.${o}.json`);if(!c.existsSync(d))return{path:d,exists:!1};let f=c.statSync(d);return{path:d,exists:!0,content:c.readFileSync(d,`utf-8`),size:f.size,lastModified:f.mtime}}};export{u as default};
@@ -1,4 +1,4 @@
1
- import"../../errors-x3Es7YJ3.js";import"../../editor-DUx1Sby2.js";import{r as e}from"../../format-CZL0rRQR.js";import"../../config-D0b5Ceh4.js";import"../../fsStore-D1omjK0d.js";import"../../base-Dv8Ajp1w.js";import"../../template-DtJFiC8I.js";import"../../xling-DxPgM9hF.js";import"../../codex-B8t10wtW.js";import"../../claudeDefault-B1OdW_1X.js";import"../../claude-BOK95KeO.js";import"../../gemini-Cc8MC-Lf.js";import{t}from"../../dispatcher-CIOJuMxR.js";import{Command as n,Flags as r}from"@oclif/core";var i=class i extends n{static summary=`Inspect configuration file status`;static description=`
1
+ import"../../errors-x3Es7YJ3.js";import"../../editor-DUx1Sby2.js";import{r as e}from"../../format-CZL0rRQR.js";import"../../config-D0b5Ceh4.js";import"../../fsStore-D1omjK0d.js";import"../../base-Dv8Ajp1w.js";import"../../template-DtJFiC8I.js";import"../../xling-DxPgM9hF.js";import"../../codex-Kk3Sv7uC.js";import"../../claudeDefault-BP2oPKZC.js";import"../../claude-BqDhM0_U.js";import"../../gemini-2eTblTJ_.js";import{t}from"../../dispatcher-DOZzJY8q.js";import{Command as n,Flags as r}from"@oclif/core";var i=class i extends n{static summary=`Inspect configuration file status`;static description=`
2
2
  Display information about the configuration file, including:
3
3
  - File path
4
4
  - Existence status
@@ -1,4 +1,4 @@
1
- import"../../errors-x3Es7YJ3.js";import"../../editor-DUx1Sby2.js";import{i as e,n as t,r as n}from"../../format-CZL0rRQR.js";import"../../config-D0b5Ceh4.js";import"../../fsStore-D1omjK0d.js";import"../../base-Dv8Ajp1w.js";import"../../template-DtJFiC8I.js";import"../../xling-DxPgM9hF.js";import"../../codex-B8t10wtW.js";import"../../claudeDefault-B1OdW_1X.js";import"../../claude-BOK95KeO.js";import"../../gemini-Cc8MC-Lf.js";import{t as r}from"../../dispatcher-CIOJuMxR.js";import{Command as i,Flags as a}from"@oclif/core";var o=class o extends i{static summary=`List all settings for a tool`;static description=`
1
+ import"../../errors-x3Es7YJ3.js";import"../../editor-DUx1Sby2.js";import{i as e,n as t,r as n}from"../../format-CZL0rRQR.js";import"../../config-D0b5Ceh4.js";import"../../fsStore-D1omjK0d.js";import"../../base-Dv8Ajp1w.js";import"../../template-DtJFiC8I.js";import"../../xling-DxPgM9hF.js";import"../../codex-Kk3Sv7uC.js";import"../../claudeDefault-BP2oPKZC.js";import"../../claude-BqDhM0_U.js";import"../../gemini-2eTblTJ_.js";import{t as r}from"../../dispatcher-DOZzJY8q.js";import{Command as i,Flags as a}from"@oclif/core";var o=class o extends i{static summary=`List all settings for a tool`;static description=`
2
2
  Display all configuration settings for the specified AI CLI tool.
3
3
  Supports multiple scopes (user, project, local, system).
4
4
  For Codex, output includes model providers and saved auth profiles.
@@ -1,4 +1,4 @@
1
- import"../../errors-x3Es7YJ3.js";import"../../editor-DUx1Sby2.js";import{r as e}from"../../format-CZL0rRQR.js";import"../../config-D0b5Ceh4.js";import"../../fsStore-D1omjK0d.js";import"../../base-Dv8Ajp1w.js";import"../../template-DtJFiC8I.js";import"../../xling-DxPgM9hF.js";import"../../codex-B8t10wtW.js";import"../../claudeDefault-B1OdW_1X.js";import"../../claude-BOK95KeO.js";import"../../gemini-Cc8MC-Lf.js";import{t}from"../../dispatcher-CIOJuMxR.js";import{Command as n,Flags as r}from"@oclif/core";import i from"node:readline/promises";import{stdin as a,stdout as o}from"node:process";var s=class s extends n{static summary=`Edit settings or add model providers`;static description=`
1
+ import"../../errors-x3Es7YJ3.js";import"../../editor-DUx1Sby2.js";import{r as e}from"../../format-CZL0rRQR.js";import"../../config-D0b5Ceh4.js";import"../../fsStore-D1omjK0d.js";import"../../base-Dv8Ajp1w.js";import"../../template-DtJFiC8I.js";import"../../xling-DxPgM9hF.js";import"../../codex-Kk3Sv7uC.js";import"../../claudeDefault-BP2oPKZC.js";import"../../claude-BqDhM0_U.js";import"../../gemini-2eTblTJ_.js";import{t}from"../../dispatcher-DOZzJY8q.js";import{Command as n,Flags as r}from"@oclif/core";import i from"node:readline/promises";import{stdin as a,stdout as o}from"node:process";var s=class s extends n{static summary=`Edit settings or add model providers`;static description=`
2
2
  Create or open settings files for AI CLI tools in your preferred editor,
3
3
  or interactively add Codex model providers.
4
4
 
@@ -1,4 +1,4 @@
1
- import"../../errors-x3Es7YJ3.js";import"../../editor-DUx1Sby2.js";import{r as e}from"../../format-CZL0rRQR.js";import"../../config-D0b5Ceh4.js";import"../../fsStore-D1omjK0d.js";import"../../base-Dv8Ajp1w.js";import"../../template-DtJFiC8I.js";import{t}from"../../xling-DxPgM9hF.js";import{t as n}from"../../codex-B8t10wtW.js";import"../../claudeDefault-B1OdW_1X.js";import{t as r}from"../../claude-BOK95KeO.js";import"../../gemini-Cc8MC-Lf.js";import{t as i}from"../../dispatcher-CIOJuMxR.js";import{Args as a,Command as o,Flags as s}from"@oclif/core";import c from"node:readline/promises";import{stdin as l,stdout as u}from"node:process";var d=class d extends o{static summary=`Switch between profiles or settings variants`;static description=`
1
+ import"../../errors-x3Es7YJ3.js";import"../../editor-DUx1Sby2.js";import{r as e}from"../../format-CZL0rRQR.js";import"../../config-D0b5Ceh4.js";import"../../fsStore-D1omjK0d.js";import"../../base-Dv8Ajp1w.js";import"../../template-DtJFiC8I.js";import{t}from"../../xling-DxPgM9hF.js";import{t as n}from"../../codex-Kk3Sv7uC.js";import"../../claudeDefault-BP2oPKZC.js";import{t as r}from"../../claude-BqDhM0_U.js";import"../../gemini-2eTblTJ_.js";import{t as i}from"../../dispatcher-DOZzJY8q.js";import{Args as a,Command as o,Flags as s}from"@oclif/core";import c from"node:readline/promises";import{stdin as l,stdout as u}from"node:process";var d=class d extends o{static summary=`Switch between profiles or settings variants`;static description=`
2
2
  Switch to a different profile configuration for Codex,
3
3
  activate a specific settings.<variant>.json for Claude,
4
4
  or switch the default model for Xling prompt router.
@@ -10,7 +10,7 @@ import"../../errors-x3Es7YJ3.js";import"../../editor-DUx1Sby2.js";import{r as e}
10
10
 
11
11
  For Xling, you can switch between any model from configured providers.
12
12
  Run without arguments for interactive selection.
13
- `;static examples=[{description:`Switch Codex to an auth profile (saved login)`,command:`<%= config.bin %> <%= command.id %> personal --tool codex`},{description:`Switch Codex to a provider`,command:`<%= config.bin %> <%= command.id %> my-provider --tool codex`},{description:`Interactive selection for Codex`,command:`<%= config.bin %> <%= command.id %> --tool codex`},{description:`Activate a Claude variant (user scope)`,command:`<%= config.bin %> <%= command.id %> hxi --tool claude --scope user`},{description:`Force-apply Claude variant and emit JSON for scripts`,command:`<%= config.bin %> <%= command.id %> hxi --tool claude --scope user --force --json`},{description:`Keep a backup while switching Claude settings`,command:`<%= config.bin %> <%= command.id %> stable --tool claude --backup`},{description:`Interactive model selection for Xling`,command:`<%= config.bin %> <%= command.id %> --tool xling`},{description:`Switch Xling default model directly`,command:`<%= config.bin %> <%= command.id %> claude-sonnet-4-20250514 --tool xling`}];static args={profile:a.string({description:`Profile name to switch to`,required:!1})};static flags={tool:s.string({char:`t`,description:`AI CLI tool to manage`,options:[`claude`,`codex`,`gemini`,`xling`],default:`claude`}),scope:s.string({char:`s`,description:`Configuration scope`,options:[`user`,`project`,`local`,`system`],default:`user`}),json:s.boolean({description:`Output JSON instead of interactive text`,default:!1}),force:s.boolean({description:`Skip confirmation prompts (Claude only)`,default:!1}),backup:s.boolean({description:`Create a .bak backup when switching (Claude only)`,default:!1})};async run(){let{args:e,flags:t}=await this.parse(d),n=new i,r=e.profile;r||=(t.json&&this.error(`Profile is required when using --json output.`,{exit:1}),await this.#t(n,t));try{let e=t.tool===`claude`?await this.#e(n,r,t):await n.execute({tool:t.tool,scope:t.scope,action:`switch-profile`,profile:r});if(!e)return;this.#u(e,r,t)}catch(e){this.error(e.message,{exit:1})}}async#e(e,t,n){n.json&&!n.force&&this.error(`--json requires --force when switching Claude settings.`,{exit:1});let r=await e.execute({tool:`claude`,scope:n.scope,action:`switch-profile`,profile:t,switchOptions:{preview:!0}});if(r.diff)this.log(`Proposed changes:
14
- `+r.diff);else return this.log(`No differences detected. Current settings already match the selected variant.`),r;let i=!!n.backup;if(!n.force&&!i){let e=await this.#c();if(e===`cancel`)return this.log(`Switch cancelled.`),null;i=e===`backup`}let a=await e.execute({tool:`claude`,scope:n.scope,action:`switch-profile`,profile:t,switchOptions:{backup:i}});return a.diff=r.diff,a}async#t(e,t){let n=t.tool,r=t.scope,i=[];n===`claude`?i=await this.#n(e,r):n===`codex`?i=await this.#r(r):n===`xling`?i=await this.#i(r):this.error(`Interactive selection is not supported for tool: ${n}`,{exit:1}),i.length||this.error(`No available profiles found for the selected tool.`,{exit:1}),this.log(`Select a profile to switch to:`),i.forEach((e,t)=>{this.log(` ${t+1}) ${e}`)});let a=c.createInterface({input:l,output:u});try{for(;;){let e=(await a.question(`Enter number or name: `)).trim().toLowerCase(),t=Number.parseInt(e,10);if(Number.isInteger(t)&&t>=1&&t<=i.length){let e=i[t-1];return n===`claude`?this.#a(e):n===`codex`?this.#o(e):n===`xling`?this.#s(e):e}let r=i.find(t=>t.toLowerCase()===e);if(r)return n===`claude`?this.#a(r):n===`codex`?this.#o(r):n===`xling`?this.#s(r):r;if(n===`claude`){let t=i.find(t=>this.#a(t).toLowerCase()===e);if(t)return this.#a(t)}if(n===`codex`){let t=i.find(t=>this.#o(t).toLowerCase()===e);if(t)return this.#o(t)}if(n===`xling`){let t=i.find(t=>this.#s(t).toLowerCase()===e);if(t)return this.#s(t)}this.log(`Invalid selection. Please try again.`)}}finally{a.close()}}async#n(e,t){let n=await e.execute({tool:`claude`,scope:t,action:`list`});if(!this.#l(n.data))return[];let i=new r().getCurrentVariant(t);return n.data.files.filter(e=>!e.active&&e.variant).map(e=>e.variant===i?`${e.variant} (current)`:e.variant)}async#r(e){let t=new n,{providers:r,authProfiles:i}=t.getAllSwitchableProfiles(e),a=await t.list(e),o=a.type===`entries`?a.entries:{},s=o.current_auth_profile,c=o.current_provider,l=o.current_profile,u=[];if(i.length>0)for(let e of i){let t=e===s;u.push(`[auth] ${e}${t?` (current)`:``}`)}if(r.length>0)for(let e of r){let t=e===c||e===l;u.push(`[provider] ${e}${t?` (current)`:``}`)}return u}async#i(e){let n=new t,r=n.getAllModels(e);r.length===0&&this.error(`No models found. Please configure providers in ~/.claude/xling.json first.
15
- Run: xling settings:set --tool xling`,{exit:1});let i=n.getDefaultModel(e);return r.map(e=>e.model===i?`${e.label} (current)`:e.label)}#a(e){return e.replace(/ \(current\)$/,``)}#o(e){let t=e.replace(/ \(current\)$/,``),n=t.match(/^\[(auth|provider)\]\s+(.+)$/);return n?n[2]:t}#s(e){let t=e.replace(/ \(current\)$/,``),n=t.match(/^\[.+?\]\s+(.+)$/);return n?n[1]:t}async#c(){let e=c.createInterface({input:l,output:u});try{for(;;){let t=(await e.question(`Choose action ([o]verwrite/[b]ackup/[c]ancel): `)).trim().toLowerCase();if([`overwrite`,`backup`,`cancel`].includes(t))return t;if([`o`,`b`,`c`].includes(t))return{o:`overwrite`,b:`backup`,c:`cancel`}[t]}}finally{e.close()}}#l(e){return!!(e&&typeof e==`object`&&`type`in e&&e.type===`files`&&`files`in e&&Array.isArray(e.files))}#u(t,n,r){if(r.json){this.log(e(t));return}if(t.preview){this.log(`Preview only. No changes applied.`),t.diff&&this.log(t.diff);return}this.log(t.message??`Switched to profile: ${n}`),t.filePath&&this.log(` File: ${t.filePath}`),t.diff&&this.log(`Applied diff:
13
+ `;static examples=[{description:`Switch Codex to an auth profile (saved login)`,command:`<%= config.bin %> <%= command.id %> personal --tool codex`},{description:`Switch Codex to a provider`,command:`<%= config.bin %> <%= command.id %> my-provider --tool codex`},{description:`Interactive selection for Codex`,command:`<%= config.bin %> <%= command.id %> --tool codex`},{description:`Activate a Claude variant (user scope)`,command:`<%= config.bin %> <%= command.id %> hxi --tool claude --scope user`},{description:`Force-apply Claude variant and emit JSON for scripts`,command:`<%= config.bin %> <%= command.id %> hxi --tool claude --scope user --force --json`},{description:`Keep a backup while switching Claude settings`,command:`<%= config.bin %> <%= command.id %> stable --tool claude --backup`},{description:`Interactive model selection for Xling`,command:`<%= config.bin %> <%= command.id %> --tool xling`},{description:`Switch Xling default model directly`,command:`<%= config.bin %> <%= command.id %> claude-sonnet-4-20250514 --tool xling`}];static args={profile:a.string({description:`Profile name to switch to`,required:!1})};static flags={tool:s.string({char:`t`,description:`AI CLI tool to manage`,options:[`claude`,`codex`,`gemini`,`xling`],default:`claude`}),scope:s.string({char:`s`,description:`Configuration scope`,options:[`user`,`project`,`local`,`system`],default:`user`}),json:s.boolean({description:`Output JSON instead of interactive text`,default:!1}),force:s.boolean({description:`Skip confirmation prompts (Claude only)`,default:!1}),backup:s.boolean({description:`Create a .bak backup when switching (Claude only)`,default:!1})};async run(){let{args:e,flags:t}=await this.parse(d),n=new i,r=e.profile;r||=(t.json&&this.error(`Profile is required when using --json output.`,{exit:1}),await this.#t(n,t));try{let e=t.tool===`claude`?await this.#e(n,r,t):await n.execute({tool:t.tool,scope:t.scope,action:`switch-profile`,profile:r});if(!e)return;this.#l(e,r,t)}catch(e){this.error(e.message,{exit:1})}}async#e(e,t,n){n.json&&!n.force&&this.error(`--json requires --force when switching Claude settings.`,{exit:1});let r=await e.execute({tool:`claude`,scope:n.scope,action:`switch-profile`,profile:t,switchOptions:{preview:!0}});if(r.diff)this.log(`Proposed changes:
14
+ `+r.diff);else return this.log(`No differences detected. Current settings already match the selected variant.`),r;let i=!!n.backup;if(!n.force&&!i){let e=await this.#s();if(e===`cancel`)return this.log(`Switch cancelled.`),null;i=e===`backup`}let a=await e.execute({tool:`claude`,scope:n.scope,action:`switch-profile`,profile:t,switchOptions:{backup:i}});return a.diff=r.diff,a}async#t(e,t){let n=t.tool,r=t.scope,i=[];n===`claude`?i=await this.#n(e,r):n===`codex`?i=await this.#r(r):n===`xling`?i=await this.#i(r):this.error(`Interactive selection is not supported for tool: ${n}`,{exit:1}),i.length||this.error(`No available profiles found for the selected tool.`,{exit:1}),this.log(`Select a profile to switch to:`),i.forEach((e,t)=>{this.log(` ${t+1}) ${e}`)});let a=c.createInterface({input:l,output:u});try{for(;;){let e=(await a.question(`Enter number or name: `)).trim().toLowerCase(),t=Number.parseInt(e,10);if(Number.isInteger(t)&&t>=1&&t<=i.length)return this.#o(n,i[t-1]);let r=i.find(t=>t.toLowerCase()===e);if(r)return this.#o(n,r);let o=i.find(t=>this.#o(n,t).toLowerCase()===e);if(o)return this.#o(n,o);this.log(`Invalid selection. Please try again.`)}}finally{a.close()}}async#n(e,t){let n=await e.execute({tool:`claude`,scope:t,action:`list`});if(!this.#c(n.data))return[];let i=new r().getCurrentVariant(t);return n.data.files.filter(e=>!e.active&&e.variant).map(e=>e.variant===i?`${e.variant} (current)`:e.variant)}async#r(e){let t=new n,{providers:r,authProfiles:i}=t.getAllSwitchableProfiles(e),a=await t.list(e),o=a.type===`entries`?a.entries:{},s=o.current_auth_profile,c=o.current_provider,l=o.current_profile,u=[];if(i.length>0)for(let e of i){let t=e===s;u.push(`[auth] ${e}${t?` (current)`:``}`)}if(r.length>0)for(let e of r){let t=e===c||e===l;u.push(`[provider] ${e}${t?` (current)`:``}`)}return u}async#i(e){let n=new t,r=n.getAllModels(e);r.length===0&&this.error(`No models found. Please configure providers in ~/.claude/xling.json first.
15
+ Run: xling settings:set --tool xling`,{exit:1});let i=n.getDefaultModel(e);return r.map(e=>e.model===i?`${e.label} (current)`:e.label)}#a(e){return e.replace(/ \(current\)$/,``)}#o(e,t){let n=this.#a(t);switch(e){case`claude`:return n;case`codex`:{let e=n.match(/^\[(auth|provider)\]\s+(.+)$/);return e?e[2]:n}case`xling`:{let e=n.match(/^\[.+?\]\s+(.+)$/);return e?e[1]:n}default:return n}}async#s(){let e=c.createInterface({input:l,output:u});try{for(;;){let t=(await e.question(`Choose action ([o]verwrite/[b]ackup/[c]ancel): `)).trim().toLowerCase();if([`overwrite`,`backup`,`cancel`].includes(t))return t;if([`o`,`b`,`c`].includes(t))return{o:`overwrite`,b:`backup`,c:`cancel`}[t]}}finally{e.close()}}#c(e){return!!(e&&typeof e==`object`&&`type`in e&&e.type===`files`&&`files`in e&&Array.isArray(e.files))}#l(t,n,r){if(r.json){this.log(e(t));return}if(t.preview){this.log(`Preview only. No changes applied.`),t.diff&&this.log(t.diff);return}this.log(t.message??`Switched to profile: ${n}`),t.filePath&&this.log(` File: ${t.filePath}`),t.diff&&this.log(`Applied diff:
16
16
  `+t.diff)}};export{d as default};
@@ -1,4 +1,4 @@
1
- import"../../errors-x3Es7YJ3.js";import{r as e}from"../../format-CZL0rRQR.js";import"../../fsStore-D1omjK0d.js";import{i as t,n,r,t as i}from"../../sync-BfqO3fnF.js";import{Command as a,Flags as o}from"@oclif/core";import s from"node:readline/promises";import{stdin as c,stdout as l}from"node:process";var u=class u extends a{static summary=`Sync config.toml between Claude Code and Codex`;static description=`
1
+ import"../../errors-x3Es7YJ3.js";import{r as e}from"../../format-CZL0rRQR.js";import"../../fsStore-D1omjK0d.js";import{i as t,n,r,t as i}from"../../sync-B6uHJ3Je.js";import{Command as a,Flags as o}from"@oclif/core";import s from"node:readline/promises";import{stdin as c,stdout as l}from"node:process";var u=class u extends a{static summary=`Sync config.toml between Claude Code and Codex`;static description=`
2
2
  Copy Claude Code config.toml into Codex (default) or reverse the direction
3
3
  with --reverse. Shows a diff first, then lets you choose overwrite,
4
4
  backup+overwrite, or cancel (similar to settings:switch).
@@ -1,4 +1,4 @@
1
- import{n as e}from"../../cli-BevqZj-b.js";import"../../errors-x3Es7YJ3.js";import"../../editor-DUx1Sby2.js";import"../../config-D0b5Ceh4.js";import"../../fsStore-D1omjK0d.js";import"../../base-Dv8Ajp1w.js";import"../../template-DtJFiC8I.js";import"../../xling-DxPgM9hF.js";import{n as t,t as n}from"../../types-BIWFx0bF.js";import{t as r}from"../../runner-BEeIEt9y.js";import{Args as i,Command as a,Flags as o}from"@oclif/core";import s from"cli-table3";var c=class c extends a{static summary=`Shortcut eXecute - run predefined command shortcuts`;static description=`
1
+ import{n as e}from"../../cli-BevqZj-b.js";import"../../errors-x3Es7YJ3.js";import"../../editor-DUx1Sby2.js";import"../../config-D0b5Ceh4.js";import"../../fsStore-D1omjK0d.js";import"../../base-Dv8Ajp1w.js";import"../../template-DtJFiC8I.js";import"../../xling-DxPgM9hF.js";import{n as t,t as n}from"../../types-BDgDAGpu.js";import{t as r}from"../../runner-BDDl4-Yr.js";import{Args as i,Command as a,Flags as o}from"@oclif/core";import s from"cli-table3";var c=class c extends a{static summary=`Shortcut eXecute - run predefined command shortcuts`;static description=`
2
2
  Execute predefined command shortcuts configured in ~/.claude/xling.json.
3
3
 
4
4
  Shortcuts allow you to create custom aliases for frequently used xling commands
@@ -1 +1 @@
1
- import{Command as e}from"@oclif/core";var t=`0.10.1`,n=class extends e{static summary=`Show the current xling version`;static description=`Displays the version from package.json.`;static examples=[{description:`Print the installed CLI version`,command:`<%= config.bin %> <%= command.id %>`},{description:`Shortcut using the built-in flag`,command:`<%= config.bin %> --version`}];async run(){this.log(t??`unknown`)}};export{n as default};
1
+ import{Command as e}from"@oclif/core";var t=`0.11.1`,n=class extends e{static summary=`Show the current xling version`;static description=`Displays the version from package.json.`;static examples=[{description:`Print the installed CLI version`,command:`<%= config.bin %> <%= command.id %>`},{description:`Shortcut using the built-in flag`,command:`<%= config.bin %> --version`}];async run(){this.log(t??`unknown`)}};export{n as default};
@@ -1,4 +1,4 @@
1
- import{n as e}from"../../cli-BevqZj-b.js";import"../../errors-x3Es7YJ3.js";import"../../runner-QW_B2Hqh.js";import"../../base-Cb8gvSZx.js";import"../../claude-CgDMZ5NR.js";import"../../codex-Czpk7Br1.js";import"../../gemini-Bf13TKO0.js";import{t}from"../../dispatcher-KWhvzTOg.js";import{Command as n,Flags as r}from"@oclif/core";var i=class i extends n{static summary=`eXecute AI CLI tools (defaults to Claude Code with yolo)`;static description=`
1
+ import"../../errors-x3Es7YJ3.js";import"../../runner-DfsWnEWI.js";import"../../base-ES3hc6uu.js";import"../../claude-BJ1kVclm.js";import"../../codex-DO3xGhyb.js";import"../../gemini-DjOdjVmz.js";import{t as e}from"../../dispatcher-CrrrsRFX.js";import{Command as t,Flags as n}from"@oclif/core";var r=class r extends t{static summary=`eXecute AI CLI tools (defaults to Claude Code with yolo)`;static description=`
2
2
  Quick launcher for Claude Code, Codex, or Gemini CLI with yolo mode enabled by default.
3
3
 
4
4
  Just run "xling x" to start Claude Code instantly!
@@ -29,4 +29,4 @@ import{n as e}from"../../cli-BevqZj-b.js";import"../../errors-x3Es7YJ3.js";impor
29
29
  $ xling x --no-yolo # Start Claude without yolo
30
30
  $ xling x -- chat "Hello" # Start Claude with arguments
31
31
  $ xling x -t codex -C /path # Start Codex in specific directory
32
- `;static examples=[{description:`Start Claude Code instantly (default)`,command:`<%= config.bin %> <%= command.id %>`},{description:`Continue last conversation`,command:`<%= config.bin %> <%= command.id %> -c`},{description:`Resume a conversation from list`,command:`<%= config.bin %> <%= command.id %> -r`},{description:`Start Claude with hxi settings variant`,command:`<%= config.bin %> <%= command.id %> -s hxi`},{description:`Continue last Codex session`,command:`<%= config.bin %> <%= command.id %> -t codex -c`},{description:`Start Codex with oss profile`,command:`<%= config.bin %> <%= command.id %> -t codex -s oss`},{description:`Start Gemini CLI (auto-accept actions)`,command:`<%= config.bin %> <%= command.id %> -t gemini`},{description:`Resume latest Gemini session`,command:`<%= config.bin %> <%= command.id %> -t gemini -c`},{description:`Start Claude without yolo mode`,command:`<%= config.bin %> <%= command.id %> --no-yolo`},{description:`Start Claude and pass arguments`,command:`<%= config.bin %> <%= command.id %> -- chat "Hello, how are you?"`},{description:`Start Codex in specific directory`,command:`<%= config.bin %> <%= command.id %> -t codex -C /path/to/project`}];static flags={tool:r.string({description:`AI CLI tool to launch`,char:`t`,options:[`claude`,`codex`,`gemini`],default:`claude`}),yolo:r.boolean({description:`Enable yolo mode (skip permission prompts)`,default:!0,allowNo:!0}),continue:r.boolean({description:`Continue last conversation/session`,char:`c`,exclusive:[`resume`]}),resume:r.boolean({description:`Resume from conversation/session list`,char:`r`,exclusive:[`continue`]}),cwd:r.string({description:`Working directory for the launched process`,char:`C`}),settings:r.string({description:`Settings configuration (Claude: variant name or file path; Codex: profile name; Gemini: model name)`,char:`s`})};static strict=!1;async run(){let{flags:n,argv:r}=await this.parse(i),a=e(r);try{let e=await new t().execute({tool:n.tool,yolo:n.yolo,continue:n.continue,resume:n.resume,cwd:n.cwd,settings:n.settings,args:a});e.success?(this.log(e.message??`Launched successfully`),e.command&&n.yolo&&this.log(`\nCommand: ${e.command}`)):this.error(e.message??`Launch failed`,{exit:1})}catch(e){this.error(e.message,{exit:1})}}};export{i as default};
32
+ `;static examples=[{description:`Start Claude Code instantly (default)`,command:`<%= config.bin %> <%= command.id %>`},{description:`Continue last conversation`,command:`<%= config.bin %> <%= command.id %> -c`},{description:`Resume a conversation from list`,command:`<%= config.bin %> <%= command.id %> -r`},{description:`Start Claude with hxi settings variant`,command:`<%= config.bin %> <%= command.id %> -s hxi`},{description:`Continue last Codex session`,command:`<%= config.bin %> <%= command.id %> -t codex -c`},{description:`Start Codex with oss profile`,command:`<%= config.bin %> <%= command.id %> -t codex -s oss`},{description:`Start Gemini CLI (auto-accept actions)`,command:`<%= config.bin %> <%= command.id %> -t gemini`},{description:`Resume latest Gemini session`,command:`<%= config.bin %> <%= command.id %> -t gemini -c`},{description:`Start Claude without yolo mode`,command:`<%= config.bin %> <%= command.id %> --no-yolo`},{description:`Start Claude and pass arguments`,command:`<%= config.bin %> <%= command.id %> -- chat "Hello, how are you?"`},{description:`Start Codex in specific directory`,command:`<%= config.bin %> <%= command.id %> -t codex -C /path/to/project`}];static flags={tool:n.string({description:`AI CLI tool to launch`,char:`t`,options:[`claude`,`codex`,`gemini`],default:`claude`}),yolo:n.boolean({description:`Enable yolo mode (skip permission prompts)`,default:!0,allowNo:!0}),continue:n.boolean({description:`Continue last conversation/session`,char:`c`,exclusive:[`resume`]}),resume:n.boolean({description:`Resume from conversation/session list`,char:`r`,exclusive:[`continue`]}),cwd:n.string({description:`Working directory for the launched process`,char:`C`}),settings:n.string({description:`Settings configuration (Claude: variant name or file path; Codex: profile name; Gemini: model name)`,char:`s`})};static strict=!1;async run(){let{flags:t,argv:n}=await this.parse(r),i=n;try{let n=await new e().execute({tool:t.tool,yolo:t.yolo,continue:t.continue,resume:t.resume,cwd:t.cwd,settings:t.settings,args:i});n.success?(this.log(n.message??`Launched successfully`),n.command&&t.yolo&&this.log(`\nCommand: ${n.command}`)):this.error(n.message??`Launch failed`,{exit:1})}catch(e){this.error(e.message,{exit:1})}}};export{r as default};
@@ -1 +1 @@
1
- import{a as e}from"./errors-x3Es7YJ3.js";import{r as t}from"./runner-QW_B2Hqh.js";import{t as n}from"./utils-DugkWRYo.js";const r={chrome:{darwin:`Google Chrome`,linux:`google-chrome`,win32:`chrome`},safari:{darwin:`Safari`},firefox:{darwin:`Firefox`,linux:`firefox`,win32:`firefox`},arc:{darwin:`Arc`,win32:`Arc`},edge:{darwin:`Microsoft Edge`,linux:`microsoft-edge`,win32:`msedge`},dia:{darwin:`Dia`,linux:`dia`,win32:`dia`}};function i(e){let t=process.platform,n=r[e]?.[t];return n?t===`darwin`?`open -a "${n}"`:n:null}async function a(r,a){let{title:o,body:s,base:c,head:l,draft:u=!1,web:d=!1,browser:f=`chrome`,assignee:p=[],reviewer:m=[],label:h=[]}=r;if(!await n())throw new e(`gh`,`Install GitHub CLI: https://cli.github.com/`);let g=[`pr`,`create`];o&&g.push(`--title`,o),s&&g.push(`--body`,s),c&&g.push(`--base`,c),l&&g.push(`--head`,l),u&&g.push(`--draft`);for(let e of p)g.push(`--assignee`,e);for(let e of m)g.push(`--reviewer`,e);for(let e of h)g.push(`--label`,e);let _;if(d){g.push(`--web`);let e=i(f);if(!e)throw Error(`Browser "${f}" is not available on ${process.platform}. Supported browsers: chrome, safari (macOS only), firefox, arc, edge, dia`);_={GH_BROWSER:e}}let v=await t(`gh`,g,{cwd:a,env:_,throwOnError:!1});if(!v.success)throw Error(`Failed to create PR: ${v.stderr}`);return{success:!0,message:d?`Created PR and opened in ${f}`:`Created PR successfully`,details:{title:o,base:c,head:l,draft:u,web:d,browser:d?f:void 0,platform:process.platform}}}export{a as t};
1
+ import{a as e}from"./errors-x3Es7YJ3.js";import{r as t}from"./runner-DfsWnEWI.js";import{t as n}from"./utils-7jommWkE.js";const r={chrome:{darwin:`Google Chrome`,linux:`google-chrome`,win32:`chrome`},safari:{darwin:`Safari`},firefox:{darwin:`Firefox`,linux:`firefox`,win32:`firefox`},arc:{darwin:`Arc`,win32:`Arc`},edge:{darwin:`Microsoft Edge`,linux:`microsoft-edge`,win32:`msedge`},dia:{darwin:`Dia`,linux:`dia`,win32:`dia`}};function i(e){let t=process.platform,n=r[e]?.[t];return n?t===`darwin`?`open -a "${n}"`:n:null}async function a(r,a){let{title:o,body:s,base:c,head:l,draft:u=!1,web:d=!1,browser:f=`chrome`,assignee:p=[],reviewer:m=[],label:h=[]}=r;if(!await n())throw new e(`gh`,`Install GitHub CLI: https://cli.github.com/`);let g=[`pr`,`create`];o&&g.push(`--title`,o),s&&g.push(`--body`,s),c&&g.push(`--base`,c),l&&g.push(`--head`,l),u&&g.push(`--draft`);for(let e of p)g.push(`--assignee`,e);for(let e of m)g.push(`--reviewer`,e);for(let e of h)g.push(`--label`,e);let _;if(d){g.push(`--web`);let e=i(f);if(!e)throw Error(`Browser "${f}" is not available on ${process.platform}. Supported browsers: chrome, safari (macOS only), firefox, arc, edge, dia`);_={GH_BROWSER:e}}let v=await t(`gh`,g,{cwd:a,env:_,throwOnError:!1});if(!v.success)throw Error(`Failed to create PR: ${v.stderr}`);return{success:!0,message:d?`Created PR and opened in ${f}`:`Created PR successfully`,details:{title:o,base:c,head:l,draft:u,web:d,browser:d?f:void 0,platform:process.platform}}}export{a as t};
@@ -1 +1 @@
1
- import{h as e}from"./errors-x3Es7YJ3.js";import{i as t}from"./runner-QW_B2Hqh.js";import{t as n}from"./claude-CgDMZ5NR.js";import{t as r}from"./codex-Czpk7Br1.js";import{t as i}from"./gemini-Bf13TKO0.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)}async execute(e){let n=this.#t(e.tool);if(!await n.validateAvailability())return{success:!1,message:`Tool "${e.tool}" is not installed or not found in PATH`};let r=e.yolo??!0,i=n.buildCommandSpec({yolo:r,resume:e.resume,continue:e.continue,settings:e.settings});try{let{pid:n,command:a}=await t(i,{cwd:e.cwd,args:e.args}),o={tool:e.tool,yolo:r,args:e.args??[]};return e.resume!==void 0&&(o.resume=e.resume),e.continue!==void 0&&(o.continue=e.continue),e.cwd&&(o.cwd=e.cwd),{success:!0,pid:n,command:a,message:`Launched ${e.tool} successfully (PID: ${n})`,data:o}}catch(t){return{success:!1,message:`Failed to launch ${e.tool}: ${t.message}`}}}#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};
1
+ import{h as e}from"./errors-x3Es7YJ3.js";import{a as t}from"./runner-DfsWnEWI.js";import{t as n}from"./claude-BJ1kVclm.js";import{t as r}from"./codex-DO3xGhyb.js";import{t as i}from"./gemini-DjOdjVmz.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)}async execute(e){let n=this.#t(e.tool);if(!await n.validateAvailability())return{success:!1,message:`Tool "${e.tool}" is not installed or not found in PATH`};let r=e.yolo??!0,i=n.buildCommandSpec({yolo:r,resume:e.resume,continue:e.continue,settings:e.settings});try{let{pid:n,command:a}=await t(i,{cwd:e.cwd,args:e.args}),o={tool:e.tool,yolo:r,args:e.args??[]};return e.resume!==void 0&&(o.resume=e.resume),e.continue!==void 0&&(o.continue=e.continue),e.cwd&&(o.cwd=e.cwd),{success:!0,pid:n,command:a,message:`Launched ${e.tool} successfully (PID: ${n})`,data:o}}catch(t){return{success:!1,message:`Failed to launch ${e.tool}: ${t.message}`}}}#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};
@@ -1 +1 @@
1
- import{h as e,l as t,m as n}from"./errors-x3Es7YJ3.js";import{t as r}from"./xling-DxPgM9hF.js";import{t as i}from"./codex-B8t10wtW.js";import{t as a}from"./claude-BOK95KeO.js";import{t as o}from"./gemini-Cc8MC-Lf.js";var s=class{#e;constructor(){this.#e=new Map,this.#e.set(`claude`,new a),this.#e.set(`codex`,new i),this.#e.set(`gemini`,new o),this.#e.set(`xling`,new r)}async execute(e){let r=this.#t(e.tool);switch(e.action){case`list`:return{success:!0,data:await r.list(e.scope)};case`switch-profile`:if(!e.profile)throw new t(`Profile is required for switch-profile action`);if(!r.switchProfile)throw new n(`switch-profile`,e.tool);return await r.switchProfile(e.scope,e.profile,e.switchOptions);case`edit`:if(!r.edit)throw new n(`edit`,e.tool);return await r.edit(e.scope,{name:e.name,ide:e.ide,provider:e.provider});case`inspect`:if(!r.inspect)throw new n(`inspect`,e.tool);return{success:!0,data:await r.inspect(e.scope,e.name)};default:throw new n(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{s as t};
1
+ import{h as e,l as t,m as n}from"./errors-x3Es7YJ3.js";import{t as r}from"./xling-DxPgM9hF.js";import{t as i}from"./codex-Kk3Sv7uC.js";import{t as a}from"./claude-BqDhM0_U.js";import{t as o}from"./gemini-2eTblTJ_.js";var s=class{#e;constructor(){this.#e=new Map,this.#e.set(`claude`,new a),this.#e.set(`codex`,new i),this.#e.set(`gemini`,new o),this.#e.set(`xling`,new r)}async execute(e){let r=this.#t(e.tool);switch(e.action){case`list`:return{success:!0,data:await r.list(e.scope)};case`switch-profile`:if(!e.profile)throw new t(`Profile is required for switch-profile action`);if(!r.switchProfile)throw new n(`switch-profile`,e.tool);return await r.switchProfile(e.scope,e.profile,e.switchOptions);case`edit`:if(!r.edit)throw new n(`edit`,e.tool);return await r.edit(e.scope,{name:e.name,ide:e.ide,provider:e.provider});case`inspect`:if(!r.inspect)throw new n(`inspect`,e.tool);return{success:!0,data:await r.inspect(e.scope,e.name)};default:throw new n(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{s as t};
@@ -1 +1 @@
1
- import{n as e}from"./utils-DugkWRYo.js";import{t}from"./pr-BNviK79Q.js";import{t as n}from"./view-zF4lc17m.js";import{t as r}from"./worktree-CrkzOfkB.js";import{t as i}from"./create-C3P6UYhE.js";var a=class{async execute(a){if(a.command!==`prv`&&await e(a.cwd),a.command===`worktree`)return r(a.data,a.cwd);if(a.command===`prr`)return t(a.data,a.cwd);if(a.command===`prv`)return n(a.data,a.cwd);if(a.command===`prc`)return i(a.data,a.cwd);throw Error(`Unknown git command: ${a.command}`)}};export{a as t};
1
+ import{n as e}from"./utils-7jommWkE.js";import{t}from"./pr-B-Wvra01.js";import{t as n}from"./view-D96BK69H.js";import{t as r}from"./worktree-D9lv01RB.js";import{t as i}from"./create-CoP40LJP.js";var a=class{async execute(a){if(a.command!==`prv`&&await e(a.cwd),a.command===`worktree`)return r(a.data,a.cwd);if(a.command===`prr`)return t(a.data,a.cwd);if(a.command===`prv`)return n(a.data,a.cwd);if(a.command===`prc`)return i(a.data,a.cwd);throw Error(`Unknown git command: ${a.command}`)}};export{a as t};
@@ -1 +1 @@
1
- import{t as e}from"./base-Cb8gvSZx.js";var t=class extends e{toolId=`gemini`;executable=`gemini`;buildCommandSpec(e){let t=[];if(e.continue?t.push(`--resume`,`latest`):e.resume&&t.push(`--list-sessions`),e.settings){let n=e.settings.split(`;`).map(e=>e.trim())[0];n&&t.push(`-m`,n)}return{executable:this.executable,baseArgs:t,yoloArgs:e.yolo?[`-y`]:void 0}}};export{t};
1
+ import{t as e}from"./base-ES3hc6uu.js";var t=class extends e{toolId=`gemini`;executable=`gemini`;buildCommandSpec(e){let t=[];if(e.continue?t.push(`--resume`,`latest`):e.resume&&t.push(`--list-sessions`),e.settings){let n=e.settings.split(`;`).map(e=>e.trim())[0];n&&t.push(`-m`,n)}return{executable:this.executable,baseArgs:t,yoloArgs:e.yolo?[`-y`]:void 0}}};export{t};
@@ -1 +1 @@
1
- import{d as e}from"./validators-kRNHvOZQ.js";import{s as t}from"./errors-x3Es7YJ3.js";import{r as n}from"./runner-QW_B2Hqh.js";import{t as r}from"./utils-DugkWRYo.js";async function i(i,o){e(i.id);let s=i.id,c=a(s),l=i.branch??`pr/${c}`,{strategy:u,remote:d=`origin`}=i;if(u!==`git`&&await r())try{if((await n(`gh`,[`pr`,`checkout`,s],{cwd:o,throwOnError:!1})).success)return{success:!0,message:`Checked out PR #${s} using GitHub CLI`,details:{strategy:`gh`,branch:l}}}catch{}let f=`pull/${c}/head:${l}`,p=await n(`git`,[`fetch`,d,f],{cwd:o,throwOnError:!1});if(!p.success)throw new t(`git fetch ${d} ${f}`,p.stderr);let m=await n(`git`,[`switch`,l],{cwd:o,throwOnError:!1});if(!m.success)throw new t(`git switch ${l}`,m.stderr);return{success:!0,message:`Checked out PR #${s} to branch '${l}' using git`,details:{strategy:`git`,branch:l,remote:d}}}function a(e){let t=e.match(/(\d+)$/);return t?t[1]:e}export{i as t};
1
+ import{d as e}from"./validators-kRNHvOZQ.js";import{s as t}from"./errors-x3Es7YJ3.js";import{r as n}from"./runner-DfsWnEWI.js";import{t as r}from"./utils-7jommWkE.js";async function i(i,o){e(i.id);let s=i.id,c=a(s),l=i.branch??`pr/${c}`,{strategy:u,remote:d=`origin`}=i;if(u!==`git`&&await r())try{if((await n(`gh`,[`pr`,`checkout`,s],{cwd:o,throwOnError:!1})).success)return{success:!0,message:`Checked out PR #${s} using GitHub CLI`,details:{strategy:`gh`,branch:l}}}catch{}let f=`pull/${c}/head:${l}`,p=await n(`git`,[`fetch`,d,f],{cwd:o,throwOnError:!1});if(!p.success)throw new t(`git fetch ${d} ${f}`,p.stderr);let m=await n(`git`,[`switch`,l],{cwd:o,throwOnError:!1});if(!m.success)throw new t(`git switch ${l}`,m.stderr);return{success:!0,message:`Checked out PR #${s} to branch '${l}' using git`,details:{strategy:`git`,branch:l,remote:d}}}function a(e){let t=e.match(/(\d+)$/);return t?t[1]:e}export{i as t};
@@ -1 +1 @@
1
- import{t as e}from"./xling-DxPgM9hF.js";import{n as t,t as n}from"./types-BIWFx0bF.js";import{spawn as r}from"node:child_process";var i=class{#e;#t;constructor(t){this.#t=t,this.#e=new e}async load(){return this.#e.getShortcuts(`user`)}async list(){let e=await this.load();return Object.entries(e).map(([e,t])=>{let n,r;if(t.command)n=`command`,r=t.command;else if(t.shell){n=`shell`;let e=this.#i(t.shell);r=e.length>50?e.substring(0,47)+`...`:e}else t.pipeline?(n=`pipeline`,r=this.#s(t.pipeline).map(e=>e.command).join(` | `)):(n=`command`,r=`unknown`);return{name:e,type:n,command:r,args:t.args||[],description:t.description}})}async run(e,n){let r=await this.load(),i=r[e];if(!i)throw new t(e,Object.keys(r));this.#d(e,i),i.command?await this.#n(i,n):i.shell?await this.#r(i.shell):i.pipeline&&await this.#o(i.pipeline)}async#n(e,t){let n=[...e.args||[],...t];await this.#t.runCommand(e.command,n)}async#r(e){return new Promise((t,n)=>{let i=this.#a(),a=r(this.#i(e),{shell:i,stdio:`inherit`});a.on(`error`,e=>{n(Error(`Failed to execute shell command: ${e.message}`))}),a.on(`exit`,e=>{e===0?t():n(Error(`Shell command exited with code ${e}`))})})}#i(e){return typeof e==`string`?e:this.#l(e)}#a(){return process.platform===`win32`?`pwsh`:!0}async#o(e){return new Promise((t,n)=>{let i=this.#s(e),a=[];for(let e=0;e<i.length;e++){let t=i[e],o=e===0,s=e===i.length-1,c=t.command,l=t.args||[],u=c===`pwsh`||c===`powershell`||c===`cmd`||c.includes(`\\`)||c.includes(`/`),d=process.platform===`win32`&&!u,f=r(c,l,{stdio:[o?`inherit`:`pipe`,s?`inherit`:`pipe`,`inherit`],shell:d,cwd:process.cwd(),env:process.env});!o&&a[e-1]&&a[e-1].stdout?.pipe(f.stdin),a.push(f),f.on(`error`,e=>{n(Error(`Failed to execute pipeline step "${t.command}": ${e.message}`))})}a[a.length-1].on(`exit`,e=>{e===0?t():n(Error(`Pipeline exited with code ${e}`))})})}#s(e){return(Array.isArray(e)?e:this.#c(e)).map(e=>({command:this.#l(e.command),args:e.args?this.#l(e.args):void 0}))}#c(e){let t=process.platform;return t===`win32`&&e.win32?e.win32:t===`darwin`&&e.darwin?e.darwin:t===`linux`&&e.linux?e.linux:e.default}#l(e){if(!this.#u(e))return e;let t=process.platform;return t===`win32`&&e.win32!==void 0?e.win32:t===`darwin`&&e.darwin!==void 0?e.darwin:t===`linux`&&e.linux!==void 0?e.linux:e.default}#u(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&`default`in e}#d(e,t){if(t.command===`sx`)throw new n(e);if(t.pipeline){let r=this.#s(t.pipeline);for(let t of r)if(t.command===`xling`&&t.args?.includes(`sx`))throw new n(e)}if(t.shell&&this.#i(t.shell).includes(`xling sx`))throw new n(e)}};export{i as t};
1
+ import{t as e}from"./xling-DxPgM9hF.js";import{n as t,t as n}from"./types-BDgDAGpu.js";import{spawn as r}from"node:child_process";var i=class{#e;#t;constructor(t){this.#t=t,this.#e=new e}async load(){return this.#e.getShortcuts(`user`)}async list(){let e=await this.load();return Object.entries(e).map(([e,t])=>{let n,r;if(t.command)n=`command`,r=t.command;else if(t.shell){n=`shell`;let e=this.#i(t.shell);r=e.length>50?e.substring(0,47)+`...`:e}else t.pipeline?(n=`pipeline`,r=this.#s(t.pipeline).map(e=>e.command).join(` | `)):(n=`command`,r=`unknown`);return{name:e,type:n,command:r,args:t.args||[],description:t.description}})}async run(e,n){let r=await this.load(),i=r[e];if(!i)throw new t(e,Object.keys(r));this.#d(e,i),i.command?await this.#n(i,n):i.shell?await this.#r(i.shell):i.pipeline&&await this.#o(i.pipeline)}async#n(e,t){let n=[...e.args||[],...t];await this.#t.runCommand(e.command,n)}async#r(e){return new Promise((t,n)=>{let i=this.#a(),a=r(this.#i(e),{shell:i,stdio:`inherit`});a.on(`error`,e=>{n(Error(`Failed to execute shell command: ${e.message}`))}),a.on(`exit`,e=>{e===0?t():n(Error(`Shell command exited with code ${e}`))})})}#i(e){return typeof e==`string`?e:this.#l(e)}#a(){return process.platform===`win32`?`pwsh`:!0}async#o(e){return new Promise((t,n)=>{let i=this.#s(e),a=[];for(let e=0;e<i.length;e++){let t=i[e],o=e===0,s=e===i.length-1,c=t.command,l=t.args||[],u=c===`pwsh`||c===`powershell`||c===`cmd`||c.includes(`\\`)||c.includes(`/`),d=process.platform===`win32`&&!u,f=r(c,l,{stdio:[o?`inherit`:`pipe`,s?`inherit`:`pipe`,`inherit`],shell:d,cwd:process.cwd(),env:process.env});!o&&a[e-1]&&a[e-1].stdout?.pipe(f.stdin),a.push(f),f.on(`error`,e=>{n(Error(`Failed to execute pipeline step "${t.command}": ${e.message}`))})}a[a.length-1].on(`exit`,e=>{e===0?t():n(Error(`Pipeline exited with code ${e}`))})})}#s(e){return(Array.isArray(e)?e:this.#c(e)).map(e=>({command:this.#l(e.command),args:e.args?this.#l(e.args):void 0}))}#c(e){let t=process.platform;return t===`win32`&&e.win32?e.win32:t===`darwin`&&e.darwin?e.darwin:t===`linux`&&e.linux?e.linux:e.default}#l(e){if(!this.#u(e))return e;let t=process.platform;return t===`win32`&&e.win32!==void 0?e.win32:t===`darwin`&&e.darwin!==void 0?e.darwin:t===`linux`&&e.linux!==void 0?e.linux:e.default}#u(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&`default`in e}#d(e,t){if(t.command===`sx`)throw new n(e);if(t.pipeline){let r=this.#s(t.pipeline);for(let t of r)if(t.command===`xling`&&t.args?.includes(`sx`))throw new n(e)}if(t.shell&&this.#i(t.shell).includes(`xling sx`))throw new n(e)}};export{i as t};
@@ -0,0 +1 @@
1
+ import{spawn as e}from"node:child_process";import*as t from"node:path";function n(e){let t=e.map(e=>e.trim()).filter(Boolean);if(t.length===0)return null;for(let e of[`.exe`,`.com`,`.cmd`,`.bat`]){let n=t.find(t=>t.toLowerCase().endsWith(e));if(n)return n}return t[0]??null}async function r(e){if(process.platform!==`win32`||t.isAbsolute(e)||t.extname(e))return e;let r=await s(`where`,[e],{silent:!0,throwOnError:!1});return!r.success||!r.stdout?e:n(r.stdout.split(/\r?\n/))??e}async function i(t,n){let i=[...t.baseArgs];t.yoloArgs&&i.push(...t.yoloArgs),n?.args&&i.push(...n.args);let a={...process.env,...t.envVars,...n?.env},o=await r(t.executable),s=e(o,i,{cwd:n?.cwd??process.cwd(),env:a,stdio:`inherit`,detached:!1}),c=`${o.includes(` `)?`"${o}"`:o} ${i.join(` `)}`;return new Promise((e,t)=>{s.on(`error`,e=>{t(Error(`Failed to spawn process: ${e.message}`))}),s.on(`spawn`,()=>{e({pid:s.pid,command:c})}),s.on(`exit`,e=>{e!==0&&e!==null&&t(Error(`Process exited with code ${e}`))})})}async function a(t){if(process.platform===`win32`){let e=await s(`where`,[t],{silent:!0,throwOnError:!1});return!e.success||!e.stdout?!1:n(e.stdout.split(/\r?\n/))!==null}return new Promise(n=>{let r=e(`which`,[t],{stdio:`ignore`});r.on(`error`,()=>n(!1)),r.on(`exit`,e=>n(e===0))})}async function o(t,n=[`--version`]){return new Promise((i,a)=>{let o=``;(async()=>{let s=e(await r(t),n,{stdio:[`ignore`,`pipe`,`pipe`]});s.stdout?.on(`data`,e=>{o+=e.toString()}),s.stderr?.on(`data`,e=>{o+=e.toString()}),s.on(`error`,e=>{a(Error(`Failed to get version: ${e.message}`))}),s.on(`exit`,e=>{e===0?i(o.trim()):a(Error(`Failed to get version`))})})().catch(e=>{a(e instanceof Error?e:Error(`Failed to get version`))})})}async function s(t,n,r={}){let{cwd:i=process.cwd(),env:a={},silent:o=!1,throwOnError:s=!0}=r;return new Promise((r,c)=>{let l=``,u=``,d=e(t,n,{cwd:i,env:{...process.env,...a},stdio:o?[`ignore`,`pipe`,`pipe`]:[`inherit`,`pipe`,`pipe`]});d.stdout?.on(`data`,e=>{l+=e.toString(),o||process.stdout.write(e)}),d.stderr?.on(`data`,e=>{u+=e.toString(),o||process.stderr.write(e)}),d.on(`error`,e=>{let t={stdout:l.trim(),stderr:e.message,exitCode:1,success:!1};s?c(t):r(t)}),d.on(`exit`,e=>{let t=e??1,n={stdout:l.trim(),stderr:u.trim(),exitCode:t,success:t===0};s&&!n.success?c(n):r(n)})})}export{i as a,n as i,o as n,s as r,a as t};
@@ -1 +1 @@
1
- import"../../errors-x3Es7YJ3.js";import"../../runner-QW_B2Hqh.js";import"../../utils-DugkWRYo.js";import{t as e}from"../../create-C3P6UYhE.js";export{e as createPr};
1
+ import"../../errors-x3Es7YJ3.js";import"../../runner-DfsWnEWI.js";import"../../utils-7jommWkE.js";import{t as e}from"../../create-CoP40LJP.js";export{e as createPr};
@@ -1 +1 @@
1
- import"../../validators-kRNHvOZQ.js";import"../../errors-x3Es7YJ3.js";import"../../runner-QW_B2Hqh.js";import"../../utils-DugkWRYo.js";import"../../pr-BNviK79Q.js";import"../../view-zF4lc17m.js";import"../../worktree-CrkzOfkB.js";import"../../create-C3P6UYhE.js";import{t as e}from"../../dispatcher-CPtFZ27f.js";export{e as GitDispatcher};
1
+ import"../../validators-kRNHvOZQ.js";import"../../errors-x3Es7YJ3.js";import"../../runner-DfsWnEWI.js";import"../../utils-7jommWkE.js";import"../../pr-B-Wvra01.js";import"../../view-D96BK69H.js";import"../../worktree-D9lv01RB.js";import"../../create-CoP40LJP.js";import{t as e}from"../../dispatcher-gwnQwr6V.js";export{e as GitDispatcher};
@@ -1 +1 @@
1
- import"../../validators-kRNHvOZQ.js";import"../../errors-x3Es7YJ3.js";import"../../runner-QW_B2Hqh.js";import"../../utils-DugkWRYo.js";import{t as e}from"../../pr-BNviK79Q.js";export{e as checkoutPr};
1
+ import"../../validators-kRNHvOZQ.js";import"../../errors-x3Es7YJ3.js";import"../../runner-DfsWnEWI.js";import"../../utils-7jommWkE.js";import{t as e}from"../../pr-B-Wvra01.js";export{e as checkoutPr};
@@ -1 +1 @@
1
- import"../../errors-x3Es7YJ3.js";import"../../runner-QW_B2Hqh.js";import{n as e,t}from"../../utils-DugkWRYo.js";export{t as detectGhCli,e as ensureGitRepo};
1
+ import"../../errors-x3Es7YJ3.js";import"../../runner-DfsWnEWI.js";import{n as e,t}from"../../utils-7jommWkE.js";export{t as detectGhCli,e as ensureGitRepo};
@@ -1 +1 @@
1
- import"../../errors-x3Es7YJ3.js";import"../../runner-QW_B2Hqh.js";import"../../utils-DugkWRYo.js";import{t as e}from"../../view-zF4lc17m.js";export{e as viewPr};
1
+ import"../../errors-x3Es7YJ3.js";import"../../runner-DfsWnEWI.js";import"../../utils-7jommWkE.js";import{t as e}from"../../view-D96BK69H.js";export{e as viewPr};
@@ -1 +1 @@
1
- import"../../errors-x3Es7YJ3.js";import"../../runner-QW_B2Hqh.js";import{t as e}from"../../worktree-CrkzOfkB.js";export{e as manageWorktree};
1
+ import"../../errors-x3Es7YJ3.js";import"../../runner-DfsWnEWI.js";import{t as e}from"../../worktree-D9lv01RB.js";export{e as manageWorktree};
@@ -1 +1 @@
1
- import"../../../runner-QW_B2Hqh.js";import{t as e}from"../../../base-Cb8gvSZx.js";export{e as BaseLaunchAdapter};
1
+ import"../../../runner-DfsWnEWI.js";import{t as e}from"../../../base-ES3hc6uu.js";export{e as BaseLaunchAdapter};
@@ -1 +1 @@
1
- import"../../../runner-QW_B2Hqh.js";import"../../../base-Cb8gvSZx.js";import{t as e}from"../../../claude-CgDMZ5NR.js";export{e as ClaudeLaunchAdapter};
1
+ import"../../../runner-DfsWnEWI.js";import"../../../base-ES3hc6uu.js";import{t as e}from"../../../claude-BJ1kVclm.js";export{e as ClaudeLaunchAdapter};
@@ -1 +1 @@
1
- import"../../../runner-QW_B2Hqh.js";import"../../../base-Cb8gvSZx.js";import{t as e}from"../../../codex-Czpk7Br1.js";export{e as CodexLaunchAdapter};
1
+ import"../../../runner-DfsWnEWI.js";import"../../../base-ES3hc6uu.js";import{t as e}from"../../../codex-DO3xGhyb.js";export{e as CodexLaunchAdapter};
@@ -1 +1 @@
1
- import"../../../runner-QW_B2Hqh.js";import"../../../base-Cb8gvSZx.js";import{t as e}from"../../../gemini-Bf13TKO0.js";export{e as GeminiLaunchAdapter};
1
+ import"../../../runner-DfsWnEWI.js";import"../../../base-ES3hc6uu.js";import{t as e}from"../../../gemini-DjOdjVmz.js";export{e as GeminiLaunchAdapter};
@@ -1 +1 @@
1
- import"../../errors-x3Es7YJ3.js";import"../../runner-QW_B2Hqh.js";import"../../base-Cb8gvSZx.js";import"../../claude-CgDMZ5NR.js";import"../../codex-Czpk7Br1.js";import"../../gemini-Bf13TKO0.js";import{t as e}from"../../dispatcher-KWhvzTOg.js";export{e as LaunchDispatcher};
1
+ import"../../errors-x3Es7YJ3.js";import"../../runner-DfsWnEWI.js";import"../../base-ES3hc6uu.js";import"../../claude-BJ1kVclm.js";import"../../codex-DO3xGhyb.js";import"../../gemini-DjOdjVmz.js";import{t as e}from"../../dispatcher-CrrrsRFX.js";export{e as LaunchDispatcher};
@@ -1 +1 @@
1
- import"../../runner-QW_B2Hqh.js";import{i as e,n as t,r as n,t as r}from"../../backend-router-aOcWH4J_.js";export{r as buildCommandSpec,t as checkBackendAvailable,n as executeViaCli,e as getExecutable};
1
+ import"../../runner-DfsWnEWI.js";import{i as e,n as t,r as n,t as r}from"../../backend-router-BVglKdTL.js";export{r as buildCommandSpec,t as checkBackendAvailable,n as executeViaCli,e as getExecutable};
@@ -1 +1 @@
1
- import"../../../errors-x3Es7YJ3.js";import"../../../editor-DUx1Sby2.js";import"../../../format-CZL0rRQR.js";import"../../../fsStore-D1omjK0d.js";import"../../../base-Dv8Ajp1w.js";import"../../../claudeDefault-B1OdW_1X.js";import{t as e}from"../../../claude-BOK95KeO.js";export{e as ClaudeAdapter};
1
+ import"../../../errors-x3Es7YJ3.js";import"../../../editor-DUx1Sby2.js";import"../../../format-CZL0rRQR.js";import"../../../fsStore-D1omjK0d.js";import"../../../base-Dv8Ajp1w.js";import"../../../claudeDefault-BP2oPKZC.js";import{t as e}from"../../../claude-BqDhM0_U.js";export{e as ClaudeAdapter};
@@ -1 +1 @@
1
- import"../../../errors-x3Es7YJ3.js";import"../../../editor-DUx1Sby2.js";import"../../../fsStore-D1omjK0d.js";import"../../../base-Dv8Ajp1w.js";import{n as e,t}from"../../../codex-B8t10wtW.js";export{t as CodexAdapter,e as isConfigObject};
1
+ import"../../../errors-x3Es7YJ3.js";import"../../../editor-DUx1Sby2.js";import"../../../fsStore-D1omjK0d.js";import"../../../base-Dv8Ajp1w.js";import{n as e,t}from"../../../codex-Kk3Sv7uC.js";export{t as CodexAdapter,e as isConfigObject};
@@ -1 +1 @@
1
- import"../../../errors-x3Es7YJ3.js";import"../../../fsStore-D1omjK0d.js";import"../../../base-Dv8Ajp1w.js";import{t as e}from"../../../gemini-Cc8MC-Lf.js";export{e as GeminiAdapter};
1
+ import"../../../errors-x3Es7YJ3.js";import"../../../fsStore-D1omjK0d.js";import"../../../base-Dv8Ajp1w.js";import{t as e}from"../../../gemini-2eTblTJ_.js";export{e as GeminiAdapter};
@@ -1 +1 @@
1
- import"../../errors-x3Es7YJ3.js";import"../../editor-DUx1Sby2.js";import"../../format-CZL0rRQR.js";import"../../config-D0b5Ceh4.js";import"../../fsStore-D1omjK0d.js";import"../../base-Dv8Ajp1w.js";import"../../template-DtJFiC8I.js";import"../../xling-DxPgM9hF.js";import"../../codex-B8t10wtW.js";import"../../claudeDefault-B1OdW_1X.js";import"../../claude-BOK95KeO.js";import"../../gemini-Cc8MC-Lf.js";import{t as e}from"../../dispatcher-CIOJuMxR.js";export{e as SettingsDispatcher};
1
+ import"../../errors-x3Es7YJ3.js";import"../../editor-DUx1Sby2.js";import"../../format-CZL0rRQR.js";import"../../config-D0b5Ceh4.js";import"../../fsStore-D1omjK0d.js";import"../../base-Dv8Ajp1w.js";import"../../template-DtJFiC8I.js";import"../../xling-DxPgM9hF.js";import"../../codex-Kk3Sv7uC.js";import"../../claudeDefault-BP2oPKZC.js";import"../../claude-BqDhM0_U.js";import"../../gemini-2eTblTJ_.js";import{t as e}from"../../dispatcher-DOZzJY8q.js";export{e as SettingsDispatcher};
@@ -1 +1 @@
1
- import"../../errors-x3Es7YJ3.js";import"../../format-CZL0rRQR.js";import"../../fsStore-D1omjK0d.js";import{i as e,n as t,r as n,t as r}from"../../sync-BfqO3fnF.js";export{r as DEFAULT_CLAUDE_CODE_TOML_PATH,t as DEFAULT_CODEX_CONFIG_PATH,n as syncClaudeTomlToCodex,e as syncCodexTomlToClaude};
1
+ import"../../errors-x3Es7YJ3.js";import"../../format-CZL0rRQR.js";import"../../fsStore-D1omjK0d.js";import{i as e,n as t,r as n,t as r}from"../../sync-B6uHJ3Je.js";export{r as DEFAULT_CLAUDE_CODE_TOML_PATH,t as DEFAULT_CODEX_CONFIG_PATH,n as syncClaudeTomlToCodex,e as syncCodexTomlToClaude};
@@ -1 +1 @@
1
- import{t as e}from"../../../claudeDefault-B1OdW_1X.js";export{e as CLAUDE_SETTINGS_TEMPLATE};
1
+ import{t as e}from"../../../claudeDefault-BP2oPKZC.js";export{e as CLAUDE_SETTINGS_TEMPLATE};
@@ -1 +1 @@
1
- import"../../errors-x3Es7YJ3.js";import"../../editor-DUx1Sby2.js";import"../../config-D0b5Ceh4.js";import"../../fsStore-D1omjK0d.js";import"../../base-Dv8Ajp1w.js";import"../../template-DtJFiC8I.js";import"../../xling-DxPgM9hF.js";import"../../types-BIWFx0bF.js";import{t as e}from"../../runner-BEeIEt9y.js";export{e as ShortcutRunner};
1
+ import"../../errors-x3Es7YJ3.js";import"../../editor-DUx1Sby2.js";import"../../config-D0b5Ceh4.js";import"../../fsStore-D1omjK0d.js";import"../../base-Dv8Ajp1w.js";import"../../template-DtJFiC8I.js";import"../../xling-DxPgM9hF.js";import"../../types-BDgDAGpu.js";import{t as e}from"../../runner-BDDl4-Yr.js";export{e as ShortcutRunner};
@@ -1 +1 @@
1
- import{n as e,t}from"../../types-BIWFx0bF.js";export{t as CircularShortcutError,e as ShortcutNotFoundError};
1
+ import{n as e,t}from"../../types-BDgDAGpu.js";export{t as CircularShortcutError,e as ShortcutNotFoundError};
@@ -1,6 +1,19 @@
1
1
  import { o as LaunchCommandSpec } from "../types-B6FSmoLE.js";
2
2
 
3
3
  //#region src/utils/runner.d.ts
4
+
5
+ /**
6
+ * Pick a spawnable Windows executable from `where <name>` output.
7
+ *
8
+ * On Windows, package managers often generate multiple shims:
9
+ * - `<name>` (no extension) for Git Bash/MSYS
10
+ * - `<name>.cmd` for cmd.exe
11
+ * - or a real `<name>.exe`
12
+ *
13
+ * Bun's `child_process.spawn()` does not reliably resolve PATHEXT shims when
14
+ * you pass the bare command name (e.g. `codex`), so we prefer explicit paths.
15
+ */
16
+ declare function selectWindowsWhereCandidate(whereLines: readonly string[]): string | null;
4
17
  interface SpawnOptions {
5
18
  cwd?: string;
6
19
  env?: Record<string, string>;
@@ -49,4 +62,4 @@ interface RunCommandResult {
49
62
  */
50
63
  declare function runCommand(command: string, args: string[], options?: RunCommandOptions): Promise<RunCommandResult>;
51
64
  //#endregion
52
- export { RunCommandOptions, RunCommandResult, SpawnOptions, SpawnResult, checkExecutable, getExecutableVersion, runCommand, spawnProcess };
65
+ export { RunCommandOptions, RunCommandResult, SpawnOptions, SpawnResult, checkExecutable, getExecutableVersion, runCommand, selectWindowsWhereCandidate, spawnProcess };
@@ -1 +1 @@
1
- import{i as e,n as t,r as n,t as r}from"../runner-QW_B2Hqh.js";export{r as checkExecutable,t as getExecutableVersion,n as runCommand,e as spawnProcess};
1
+ import{a as e,i as t,n,r,t as i}from"../runner-DfsWnEWI.js";export{i as checkExecutable,n as getExecutableVersion,r as runCommand,t as selectWindowsWhereCandidate,e as spawnProcess};
@@ -1 +1 @@
1
- import{c as e}from"./errors-x3Es7YJ3.js";import{r as t,t as n}from"./runner-QW_B2Hqh.js";async function r(n=process.cwd()){try{let r=await t(`git`,[`rev-parse`,`--is-inside-work-tree`],{cwd:n,silent:!0,throwOnError:!1});if(!r.success||r.stdout.trim()!==`true`)throw new e(n)}catch{throw new e(n)}}async function i(){return await n(`gh`)}export{r as n,i as t};
1
+ import{c as e}from"./errors-x3Es7YJ3.js";import{r as t,t as n}from"./runner-DfsWnEWI.js";async function r(n=process.cwd()){try{let r=await t(`git`,[`rev-parse`,`--is-inside-work-tree`],{cwd:n,silent:!0,throwOnError:!1});if(!r.success||r.stdout.trim()!==`true`)throw new e(n)}catch{throw new e(n)}}async function i(){return await n(`gh`)}export{r as n,i as t};
@@ -1 +1 @@
1
- import{a as e}from"./errors-x3Es7YJ3.js";import{r as t}from"./runner-QW_B2Hqh.js";import{t as n}from"./utils-DugkWRYo.js";const r={chrome:{darwin:`Google Chrome`,linux:`google-chrome`,win32:`chrome`},safari:{darwin:`Safari`},firefox:{darwin:`Firefox`,linux:`firefox`,win32:`firefox`},arc:{darwin:`Arc`,win32:`Arc`},edge:{darwin:`Microsoft Edge`,linux:`microsoft-edge`,win32:`msedge`},dia:{darwin:`Dia`,linux:`dia`,win32:`dia`}};function i(e){let t=process.platform,n=r[e]?.[t];return n?t===`darwin`?`open -a "${n}"`:n:null}async function a(r,a){let{id:o,browser:s=`chrome`,openFlags:c=[]}=r;if(!await n())throw new e(`gh`,`Install GitHub CLI: https://cli.github.com/`);let l=i(s);if(!l)throw Error(`Browser "${s}" is not available on ${process.platform}. Supported browsers: chrome, safari (macOS only), firefox, arc, edge, dia`);let u={GH_BROWSER:l},d=await t(`gh`,[`pr`,`view`,o,`--web`,...c],{cwd:a,env:u,throwOnError:!1});if(!d.success)throw Error(`Failed to open PR #${o}: ${d.stderr}`);return{success:!0,message:`Opened PR #${o} in ${s}`,details:{id:o,browser:s,platform:process.platform}}}export{a as t};
1
+ import{a as e}from"./errors-x3Es7YJ3.js";import{r as t}from"./runner-DfsWnEWI.js";import{t as n}from"./utils-7jommWkE.js";const r={chrome:{darwin:`Google Chrome`,linux:`google-chrome`,win32:`chrome`},safari:{darwin:`Safari`},firefox:{darwin:`Firefox`,linux:`firefox`,win32:`firefox`},arc:{darwin:`Arc`,win32:`Arc`},edge:{darwin:`Microsoft Edge`,linux:`microsoft-edge`,win32:`msedge`},dia:{darwin:`Dia`,linux:`dia`,win32:`dia`}};function i(e){let t=process.platform,n=r[e]?.[t];return n?t===`darwin`?`open -a "${n}"`:n:null}async function a(r,a){let{id:o,browser:s=`chrome`,openFlags:c=[]}=r;if(!await n())throw new e(`gh`,`Install GitHub CLI: https://cli.github.com/`);let l=i(s);if(!l)throw Error(`Browser "${s}" is not available on ${process.platform}. Supported browsers: chrome, safari (macOS only), firefox, arc, edge, dia`);let u={GH_BROWSER:l},d=await t(`gh`,[`pr`,`view`,o,`--web`,...c],{cwd:a,env:u,throwOnError:!1});if(!d.success)throw Error(`Failed to open PR #${o}: ${d.stderr}`);return{success:!0,message:`Opened PR #${o} in ${s}`,details:{id:o,browser:s,platform:process.platform}}}export{a as t};
@@ -1,4 +1,4 @@
1
- import{s as e}from"./errors-x3Es7YJ3.js";import{r as t}from"./runner-QW_B2Hqh.js";import n from"node:readline";import{existsSync as r}from"node:fs";import i from"node:path";function a(e){return i.basename(e)}function o(e,t){let n=a(e),r=t.replace(/\//g,`-`);return i.join(e,`..`,`${n}-${r}`)}function s(e,t){t.path&&e.push({path:t.path,branch:t.branch,head:t.head})}function c(e){let t=[],n=e.trim().split(`
1
+ import{s as e}from"./errors-x3Es7YJ3.js";import{r as t}from"./runner-DfsWnEWI.js";import n from"node:readline";import{existsSync as r}from"node:fs";import i from"node:path";function a(e){return i.basename(e)}function o(e,t){let n=a(e),r=t.replace(/\//g,`-`);return i.join(e,`..`,`${n}-${r}`)}function s(e,t){t.path&&e.push({path:t.path,branch:t.branch,head:t.head})}function c(e){let t=[],n=e.trim().split(`
2
2
  `),r={};for(let e of n)e.startsWith(`worktree `)?(s(t,r),r={path:e.substring(9)}):e.startsWith(`HEAD `)?r.head=e.substring(5):e.startsWith(`branch `)?r.branch=e.substring(7).replace(`refs/heads/`,``):e===``&&(s(t,r),r={});return s(t,r),t}async function l(n){let r=await t(`git`,[`worktree`,`list`,`--porcelain`],{cwd:n,throwOnError:!1});if(!r.success)throw new e(`git worktree list`,r.stderr);return c(r.stdout)}async function u(n){let r=await t(`git`,[`branch`,`--format=%(refname:short)`,`--sort=-committerdate`],{cwd:n,throwOnError:!1});if(!r.success)throw new e(`git branch --format=%(refname:short)`,r.stderr);return r.stdout.split(`
3
3
  `).map(e=>e.trim()).filter(Boolean)}async function d(e,n){return(await t(`git`,[`rev-parse`,`--verify`,`--quiet`,n],{cwd:e,throwOnError:!1,silent:!0})).success}async function f(e,t,r=0){if(t.length===0)throw Error(`No options available for selection.`);let i=process.stdin,a=process.stdout;if(!i.isTTY||!a.isTTY)throw Error(`Interactive selection requires a TTY. Remove --select to continue.`);n.emitKeypressEvents(i),i.resume();let o=!!i.isRaw;i.setRawMode&&i.setRawMode(!0);let s=Math.min(Math.max(r,0),t.length-1),c=0,l=()=>{a.moveCursor(0,-c),a.clearScreenDown();let n=[e,`Use ↑/↓ then Enter to confirm. Press q or Ctrl+C to cancel.`,...t.map((e,t)=>{let n=`${t===s?`➜`:` `} ${e.label}`;return t===s?`\x1B[36m${n}\x1B[0m`:n})];a.write(n.join(`
4
4
  `)+`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xling",
3
- "version": "0.10.1",
3
+ "version": "0.11.1",
4
4
  "description": "Unified CLI for AI tools: settings management, API proxy with load balancing, multi-model discussions",
5
5
  "homepage": "https://github.com/kingsword09/xling/tree/main#readme",
6
6
  "bugs": {
@@ -1 +0,0 @@
1
- import{t as e}from"./errors-x3Es7YJ3.js";import{n as t,t as n}from"./editor-DUx1Sby2.js";import{a as r,c as i,d as a,f as o,g as s,l as c,m as l,o as u,p as d,r as f,t as p}from"./fsStore-D1omjK0d.js";import{t as m}from"./base-Dv8Ajp1w.js";import*as h from"node:path";const g=`~/.codex/auth-profiles`,_=`~/.codex/auth.json`;var v=class extends m{toolId=`codex`;async list(e){let t=this.validateAndResolvePath(e),n=this.readConfig(t),r=this.#c(n),i=this.listAuthProfiles(),a=u(_),o=typeof n.current_auth_profile==`string`?n.current_auth_profile:a||i.length>0?this.#d():null;return{type:`entries`,entries:{current_provider:typeof n.model_provider==`string`?n.model_provider:null,current_profile:typeof n.current_profile==`string`?n.current_profile:null,current_auth_profile:o,providers:r,auth_profiles:i},filePath:t}}async inspect(e,t){let n=this.validateAndResolvePath(e),r=l(n),a=u(n),o=a?this.#s(n):{},s=a?i(n):null,c=t?.trim();if(c){if(this.isAuthProfile(c)){let e=`${g}/${c}.json`,t=this.#u(e),n=i(e);return{path:l(e),exists:u(e),content:JSON.stringify({mode:`auth`,authProfile:c,authFile:l(e),configFile:r,authData:t},null,2),size:n?.size,lastModified:n?.lastModified}}let e=y(o.model_providers)?o.model_providers:{};if(e[c])return{path:r,exists:a,content:JSON.stringify({mode:`provider`,currentProvider:c,config:e[c]??{}},null,2),size:s?.size,lastModified:s?.lastModified};let t=y(o.profiles)?o.profiles:{};return t[c]?{path:r,exists:a,content:JSON.stringify({mode:`profile`,currentProfile:c,config:t[c]??{}},null,2),size:s?.size,lastModified:s?.lastModified}:{path:r,exists:a,content:JSON.stringify({mode:`not_found`,requested:c,availableProviders:Object.keys(e),availableProfiles:Object.keys(t),availableAuthProfiles:this.listAuthProfiles()},null,2),size:s?.size,lastModified:s?.lastModified}}if(!a)return this.#e(r);if(o.current_profile&&typeof o.current_profile==`string`)return this.#t(o,r,s);if(o.model_provider&&typeof o.model_provider==`string`)return this.#n(o,r,s);let d=typeof o.current_auth_profile==`string`?o.current_auth_profile:null;return d||u(_)?this.#r(d,r,s):this.#i(r,s)}#e(e){if(u(_)){let e=this.#l(),t=this.#d();return{path:l(_),exists:!0,content:JSON.stringify({mode:`auth`,currentAuthProfile:t,authFile:l(_),authData:e},null,2)}}return{path:e,exists:!1}}#t(e,t,n){let r=e.current_profile,i=(y(e.profiles)?e.profiles:{})[r];return{path:t,exists:!0,content:JSON.stringify({mode:`profile`,currentProfile:r,config:y(i)?i:{}},null,2),size:n?.size,lastModified:n?.lastModified}}#n(e,t,n){let r=e.model_provider,i=(y(e.model_providers)?e.model_providers:{})[r];return{path:t,exists:!0,content:JSON.stringify({mode:`provider`,currentProvider:r,config:y(i)?i:{}},null,2),size:n?.size,lastModified:n?.lastModified}}#r(e,t,n){let r=this.#l(),i=e||this.#d();return{path:l(_),exists:!0,content:JSON.stringify({mode:`auth`,currentAuthProfile:i,authFile:l(_),configFile:t,authData:r},null,2),size:n?.size,lastModified:n?.lastModified}}#i(e,t){return{path:e,exists:!0,content:JSON.stringify({mode:`none`,message:`No active provider or auth configured. Run 'codex login' or configure a model_provider.`,configFile:e},null,2),size:t?.size,lastModified:t?.lastModified}}resolvePath(e){switch(e){case`user`:return`~/.codex/config.toml`;default:throw Error(`Unsupported scope for Codex: ${e}`)}}validateScope(e){return e===`user`}async switchProfile(e,t,n){return this.validateAndResolvePath(e),this.isAuthProfile(t)?this.#a(t):this.#o(e,t)}async edit(e,i){let a=this.validateAndResolvePath(e);if(!i.provider){let e=l(a);r(h.dirname(e)),u(a)||this.writeConfig(a,{});let o=t(i.ide);return await n(o,e),{success:!0,message:`Opened Codex config in ${o}`,filePath:e}}let o=i.provider.id?.trim()||i.provider.name?.trim();if(!o)throw Error(`Provider name cannot be empty`);let s=i.provider.base_url?.trim();if(!s)throw Error(`Base URL is required for Codex providers`);let c=i.provider.name?.trim()||o,d=i.provider.experimental_bearer_token?.trim();if(!d)throw Error(`Experimental bearer token is required for Codex providers`);let f=this.#s(a),p=y(f.model_providers)?{...f.model_providers}:{};p[o]={name:c,base_url:s,wire_api:`responses`,experimental_bearer_token:d};let m={...f,model_providers:p};return this.writeConfig(a,m),{success:!0,message:`Added model_providers.${o}`,filePath:l(a),data:p[o]}}listAuthProfiles(){return c(g).filter(e=>e.endsWith(`.json`)).map(e=>e.replace(`.json`,``))}isAuthProfile(e){return u(`${g}/${e}.json`)}saveAuthProfile(e,t=!1){let n=`${g}/${e}.json`;return u(_)?!t&&u(n)?{success:!1,message:`Profile "${e}" already exists. Use --force to overwrite.`}:(r(g),p(_,n),f(_),{success:!0,message:`Saved current auth as profile: ${e}\nauth.json has been removed. You can now login with another account.`,filePath:l(n)}):{success:!1,message:`No auth.json found. Please run 'codex login' first.`}}deleteAuthProfile(e){let t=`${g}/${e}.json`;return u(t)?(f(t),{success:!0,message:`Deleted auth profile: ${e}`}):{success:!1,message:`Auth profile "${e}" not found.`}}getAllSwitchableProfiles(e){let t=this.resolvePath(e),n=[];try{let e=this.readConfig(t),r=e.model_providers;y(r)&&(n=Object.keys(r));let i=e.profiles;y(i)&&(n=[...new Set([...n,...Object.keys(i)])])}catch{}let r=this.listAuthProfiles();return{providers:n,authProfiles:r}}#a(e){let t=`${g}/${e}.json`,n=`~/.codex/config.toml`;if(!u(t))return{success:!1,message:`Auth profile "${e}" not found.`};p(t,_);try{let t=this.#s(n);delete t.model_provider,delete t.current_profile,t.current_auth_profile=e,this.writeConfig(n,t)}catch{this.writeConfig(n,{current_auth_profile:e})}return{success:!0,message:`Switched to auth profile: ${e}`,filePath:l(_)}}#o(e,t){let n=this.resolvePath(e);u(_)&&f(_);let r=this.#s(n);delete r.current_auth_profile;let i=r.profiles,a=(y(i)?i:void 0)?.[t];if(y(a)){let e={...r};for(let[t,n]of Object.entries(a))e[t]=n;return e.current_profile=t,delete e.model_provider,this.writeConfig(n,e),{success:!0,message:`Switched to profile: ${t}`,filePath:l(n)}}delete r.current_profile;let o={...r,model_provider:t};return this.writeConfig(n,o),{success:!0,message:`Switched to provider: ${t}`,filePath:l(n)}}readConfig(e){return d(e)}writeConfig(e,t){s(e,t,!1)}#s(t){try{return this.readConfig(t)}catch(t){if(t instanceof e)return{};throw t}}#c(e){let t=e.model_providers;return y(t)?t:{}}#l(){if(!u(_))return null;try{return o(_)}catch{return null}}#u(e){if(!u(e))return null;try{return o(e)}catch{return null}}#d(){if(!u(_))return`default`;let e;try{e=a(_)}catch{return`default`}let t=this.listAuthProfiles();for(let n of t){let t=`${g}/${n}.json`;try{let r=a(t);if(e===r)return n}catch{continue}}return`default`}};const y=e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&!(e instanceof Date);export{y as n,v as t};
@@ -1 +0,0 @@
1
- import{spawn as e}from"node:child_process";async function t(t,n){let r=[...t.baseArgs];t.yoloArgs&&r.push(...t.yoloArgs),n?.args&&r.push(...n.args);let i={...process.env,...t.envVars,...n?.env},a=e(t.executable,r,{cwd:n?.cwd??process.cwd(),env:i,stdio:`inherit`,detached:!1}),o=`${t.executable} ${r.join(` `)}`;return new Promise((e,t)=>{a.on(`error`,e=>{t(Error(`Failed to spawn process: ${e.message}`))}),a.on(`spawn`,()=>{e({pid:a.pid,command:o})}),a.on(`exit`,e=>{e!==0&&e!==null&&t(Error(`Process exited with code ${e}`))})})}async function n(t){return new Promise(n=>{let r=e(process.platform===`win32`?`where`:`which`,[t],{stdio:`ignore`});r.on(`error`,()=>n(!1)),r.on(`exit`,e=>n(e===0))})}async function r(t,n=[`--version`]){return new Promise((r,i)=>{let a=``,o=e(t,n,{stdio:[`ignore`,`pipe`,`pipe`]});o.stdout?.on(`data`,e=>{a+=e.toString()}),o.stderr?.on(`data`,e=>{a+=e.toString()}),o.on(`error`,e=>{i(Error(`Failed to get version: ${e.message}`))}),o.on(`exit`,e=>{e===0?r(a.trim()):i(Error(`Failed to get version`))})})}async function i(t,n,r={}){let{cwd:i=process.cwd(),env:a={},silent:o=!1,throwOnError:s=!0}=r;return new Promise((r,c)=>{let l=``,u=``,d=e(t,n,{cwd:i,env:{...process.env,...a},stdio:o?[`ignore`,`pipe`,`pipe`]:[`inherit`,`pipe`,`pipe`]});d.stdout?.on(`data`,e=>{l+=e.toString(),o||process.stdout.write(e)}),d.stderr?.on(`data`,e=>{u+=e.toString(),o||process.stderr.write(e)}),d.on(`error`,e=>{let t={stdout:l.trim(),stderr:e.message,exitCode:1,success:!1};s?c(t):r(t)}),d.on(`exit`,e=>{let t=e??1,n={stdout:l.trim(),stderr:u.trim(),exitCode:t,success:t===0};s&&!n.success?c(n):r(n)})})}export{t as i,r as n,i as r,n as t};
File without changes
File without changes
File without changes