@qitqode/qitqode-android-arm64 0.1.20 → 0.1.22

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 (79) hide show
  1. package/bundle/{chunk-rdsae6k4.js → chunk-04ezvjjf.js} +1 -1
  2. package/bundle/{chunk-wmqcz5rb.js → chunk-07b36w5g.js} +1 -1
  3. package/bundle/{chunk-1qw3yh13.js → chunk-0jv8r99k.js} +3 -3
  4. package/bundle/chunk-0qrpg3n8.js +2 -0
  5. package/bundle/{chunk-6tjghyx6.js → chunk-18xhxdsh.js} +1 -1
  6. package/bundle/{chunk-5549c7mb.js → chunk-1zb95qfx.js} +1 -1
  7. package/bundle/{chunk-knwayz0m.js → chunk-2bbvvh0d.js} +1 -1
  8. package/bundle/{chunk-k5vwx1nv.js → chunk-2bxy8zm1.js} +1 -1
  9. package/bundle/{chunk-b2ky15zx.js → chunk-2epf5806.js} +1 -1
  10. package/bundle/{chunk-aej69zjj.js → chunk-2p6w3w8f.js} +1 -1
  11. package/bundle/{chunk-q39h31te.js → chunk-3f6t3wde.js} +3 -3
  12. package/bundle/{chunk-8k1q3g8s.js → chunk-40vz0fhv.js} +1 -1
  13. package/bundle/{chunk-fegrrsfj.js → chunk-50aznc8e.js} +1 -1
  14. package/bundle/{chunk-dvn528qs.js → chunk-5a80qybt.js} +1 -1
  15. package/bundle/{chunk-r2waj5n2.js → chunk-6hkv9411.js} +1 -1
  16. package/bundle/{chunk-9a5nck3f.js → chunk-6pe3xzkk.js} +1 -1
  17. package/bundle/{chunk-w0fg8n1f.js → chunk-73d0dy03.js} +1 -1
  18. package/bundle/{chunk-b49rxw15.js → chunk-7az1bpy8.js} +1 -1
  19. package/bundle/{chunk-c4mxtqyq.js → chunk-8r4xs1q9.js} +1 -1
  20. package/bundle/{chunk-xb031er5.js → chunk-8x6x3g16.js} +1 -1
  21. package/bundle/{chunk-w8rvjbgr.js → chunk-9ac4h2d9.js} +1 -1
  22. package/bundle/{chunk-3makpbng.js → chunk-a3a9bbk7.js} +1 -1
  23. package/bundle/{chunk-1q2vhe78.js → chunk-anqjy235.js} +1 -1
  24. package/bundle/{chunk-0x0a51w3.js → chunk-b5h8vd5n.js} +1 -1
  25. package/bundle/{chunk-3gdqmave.js → chunk-bn6mg34g.js} +2 -2
  26. package/bundle/{chunk-k728fzrr.js → chunk-btjcs9ee.js} +1 -1
  27. package/bundle/{chunk-p77m937s.js → chunk-c6wrjyep.js} +1 -1
  28. package/bundle/{chunk-pn77fh9b.js → chunk-cckshvkb.js} +1 -1
  29. package/bundle/{chunk-gspdrdyq.js → chunk-dcyzpkww.js} +1 -1
  30. package/bundle/{chunk-k6z419yx.js → chunk-dgsg31vm.js} +1 -1
  31. package/bundle/{chunk-jc0wbpjq.js → chunk-ds162xgb.js} +1 -1
  32. package/bundle/{chunk-hjvje9xj.js → chunk-eb0ksh4x.js} +1 -1
  33. package/bundle/{chunk-4pedvzse.js → chunk-f03yje8k.js} +1 -1
  34. package/bundle/{chunk-anse7bd0.js → chunk-fssgbz70.js} +1 -1
  35. package/bundle/{chunk-mpn5qm9j.js → chunk-fyd31m33.js} +1 -1
  36. package/bundle/{chunk-0fwz5r1k.js → chunk-fydd2nmw.js} +1 -1
  37. package/bundle/{chunk-9g4hz1st.js → chunk-g2bw2qf5.js} +1 -1
  38. package/bundle/{chunk-qq48ffjc.js → chunk-h5wh2d49.js} +1 -1
  39. package/bundle/{chunk-0pbpzty2.js → chunk-ha5qct06.js} +1 -1
  40. package/bundle/{chunk-fgqrcjsm.js → chunk-hf0gny5t.js} +1 -1
  41. package/bundle/{chunk-n0y1ea17.js → chunk-ht1hqsaa.js} +1 -1
  42. package/bundle/{chunk-7myavy3p.js → chunk-jee9y4t0.js} +1 -1
  43. package/bundle/{chunk-tp7sfreh.js → chunk-k6eyc1wv.js} +1 -1
  44. package/bundle/{chunk-p41h8naw.js → chunk-k9m536te.js} +1 -1
  45. package/bundle/{chunk-7nas10jx.js → chunk-kv58j3yk.js} +1 -1
  46. package/bundle/{chunk-dp3hqm2m.js → chunk-mbkw9s6e.js} +1 -1
  47. package/bundle/{chunk-1gj0m10e.js → chunk-msqx5bb0.js} +1 -1
  48. package/bundle/{chunk-s2g5989e.js → chunk-n39gqxkz.js} +1 -1
  49. package/bundle/{chunk-vh8w0ea8.js → chunk-nk42gy65.js} +1 -1
  50. package/bundle/{chunk-v7yvnnmr.js → chunk-p20ft5mj.js} +1 -1
  51. package/bundle/{chunk-ej3gmaba.js → chunk-qq9pvscd.js} +1 -1
  52. package/bundle/{chunk-2w154wad.js → chunk-qwf258sw.js} +1 -1
  53. package/bundle/{chunk-zafrxr1q.js → chunk-qy9s3nmy.js} +1 -1
  54. package/bundle/{chunk-dgbvsnqb.js → chunk-r0zsgad8.js} +1 -1
  55. package/bundle/{chunk-1brsnwhv.js → chunk-r4hkkcj4.js} +1 -1
  56. package/bundle/{chunk-28knamc9.js → chunk-rbrkvj3x.js} +1 -1
  57. package/bundle/{chunk-zfvk6zjj.js → chunk-rhgfyvth.js} +1 -1
  58. package/bundle/{chunk-ysxmk1z1.js → chunk-rpy4rgmm.js} +1 -1
  59. package/bundle/{chunk-skjge2wh.js → chunk-rry321tn.js} +1 -1
  60. package/bundle/{chunk-y36ggefa.js → chunk-t8365msg.js} +1 -1
  61. package/bundle/{chunk-ghmctw8s.js → chunk-tcp31yv0.js} +1 -1
  62. package/bundle/{chunk-ckhhm2m8.js → chunk-th189x63.js} +1 -1
  63. package/bundle/{chunk-3fzgbam3.js → chunk-v07wtbmt.js} +1 -1
  64. package/bundle/{chunk-xbxgrwvy.js → chunk-v6kenrks.js} +1 -1
  65. package/bundle/{chunk-471yj527.js → chunk-vmhq6cyz.js} +1 -1
  66. package/bundle/{chunk-gfm4vad7.js → chunk-vpp88hhd.js} +173 -173
  67. package/bundle/{chunk-6bq7rx7m.js → chunk-vvs87e61.js} +1 -1
  68. package/bundle/chunk-wg0849tq.js +2 -0
  69. package/bundle/{chunk-nt07vncv.js → chunk-x4b0ywbs.js} +1 -1
  70. package/bundle/{chunk-c422awkv.js → chunk-x8w2xgx6.js} +1 -1
  71. package/bundle/{chunk-pskkmca2.js → chunk-xj0ba60b.js} +1 -1
  72. package/bundle/{chunk-rmmrnx95.js → chunk-xjdxyeja.js} +1 -1
  73. package/bundle/{chunk-f57rqsby.js → chunk-xtfcdgwe.js} +1 -1
  74. package/bundle/{chunk-wnjg8mmh.js → chunk-zbvf09bm.js} +1 -1
  75. package/bundle/index.js +3 -3
  76. package/bundle/worker.js +1 -1
  77. package/package.json +1 -1
  78. package/bundle/chunk-7pqevqry.js +0 -2
  79. package/bundle/chunk-p4pc1zdd.js +0 -2
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Dl as s,El as t,Fl as u,Hl as v,Il as w}from"./chunk-7myavy3p.js";import"./chunk-fegrrsfj.js";import{Gn as q,Hn as r,Im as a,in as b,jn as c,kn as d,ln as e,mn as f,nn as g,on as h,pn as i,qn as j,rn as k,tn as l,un as m,vn as n,xn as o,zn as p}from"./chunk-c4x99ayd.js";import"./chunk-tq258v8s.js";import"./chunk-jfy6bfvv.js";import"./chunk-aej69zjj.js";import"./chunk-k5vwx1nv.js";import"./chunk-ej3gmaba.js";import"./chunk-3nc9wy1m.js";import"./chunk-dhvwrrqx.js";import"./chunk-56cty7nr.js";import"./chunk-v7yvnnmr.js";import"./chunk-b5x3zghc.js";import"./chunk-t1f7jeat.js";import"./chunk-tk6gjy9d.js";import"./chunk-pkdk0ppc.js";import"./chunk-hrnx60em.js";import"./chunk-bbznk59q.js";import"./chunk-01gtn79f.js";import"./chunk-meaa7wrs.js";import"./chunk-fa03gsff.js";export{a as sql,e as or,f as not,c as ne,j as lte,i as lt,p as like,l as isNull,m as isNotNull,k as inArray,h as gte,g as gt,n as exists,b as eq,r as desc,t as count,o as between,q as asc,d as and,w as Storage,v as NotFoundError,s as JsonMigration,u as Database};
2
+ import{Dl as s,El as t,Fl as u,Hl as v,Il as w}from"./chunk-jee9y4t0.js";import"./chunk-50aznc8e.js";import{Gn as q,Hn as r,Im as a,in as b,jn as c,kn as d,ln as e,mn as f,nn as g,on as h,pn as i,qn as j,rn as k,tn as l,un as m,vn as n,xn as o,zn as p}from"./chunk-c4x99ayd.js";import"./chunk-tq258v8s.js";import"./chunk-jfy6bfvv.js";import"./chunk-2p6w3w8f.js";import"./chunk-2bxy8zm1.js";import"./chunk-qq9pvscd.js";import"./chunk-3nc9wy1m.js";import"./chunk-dhvwrrqx.js";import"./chunk-56cty7nr.js";import"./chunk-p20ft5mj.js";import"./chunk-b5x3zghc.js";import"./chunk-t1f7jeat.js";import"./chunk-tk6gjy9d.js";import"./chunk-pkdk0ppc.js";import"./chunk-hrnx60em.js";import"./chunk-bbznk59q.js";import"./chunk-01gtn79f.js";import"./chunk-meaa7wrs.js";import"./chunk-fa03gsff.js";export{a as sql,e as or,f as not,c as ne,j as lte,i as lt,p as like,l as isNull,m as isNotNull,k as inArray,h as gte,g as gt,n as exists,b as eq,r as desc,t as count,o as between,q as asc,d as and,w as Storage,v as NotFoundError,s as JsonMigration,u as Database};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{m as a}from"./chunk-vpp88hhd.js";import"./chunk-a3a9bbk7.js";import"./chunk-40vz0fhv.js";import"./chunk-3w60y2x5.js";import"./chunk-zbvf09bm.js";import"./chunk-jj7wrfty.js";import"./chunk-43xq4p51.js";import"./chunk-3degq6rv.js";import"./chunk-hf0gny5t.js";import"./chunk-fd1vbz1f.js";import"./chunk-7b69jj5g.js";import"./chunk-x1dfc7qd.js";import"./chunk-en7nxqvn.js";import"./chunk-v9sfzkg5.js";import"./chunk-djcsvcby.js";import"./chunk-ntmn6epc.js";import"./chunk-1zb95qfx.js";import"./chunk-cckshvkb.js";import"./chunk-th189x63.js";import"./chunk-k6eyc1wv.js";import"./chunk-tz8qhbk9.js";import"./chunk-3f6t3wde.js";import"./chunk-b5h8vd5n.js";import"./chunk-jee9y4t0.js";import"./chunk-50aznc8e.js";import"./chunk-c4x99ayd.js";import"./chunk-73d0dy03.js";import"./chunk-ha5qct06.js";import"./chunk-w8xaw2dv.js";import"./chunk-tq258v8s.js";import"./chunk-ds162xgb.js";import"./chunk-jfy6bfvv.js";import"./chunk-2p6w3w8f.js";import"./chunk-98nh88th.js";import"./chunk-t7v8wzr9.js";import"./chunk-er5q8nhp.js";import"./chunk-cqtkxwd8.js";import"./chunk-h6htvj2y.js";import"./chunk-2qy62cv4.js";import"./chunk-t2n6fmpy.js";import"./chunk-x1naayst.js";import"./chunk-ng85b73s.js";import"./chunk-2bxy8zm1.js";import"./chunk-qq9pvscd.js";import"./chunk-3nc9wy1m.js";import"./chunk-r8ddb02d.js";import"./chunk-dhvwrrqx.js";import"./chunk-56cty7nr.js";import"./chunk-thbjhgw0.js";import"./chunk-p20ft5mj.js";import"./chunk-b5x3zghc.js";import"./chunk-t1f7jeat.js";import"./chunk-tk6gjy9d.js";import"./chunk-pkdk0ppc.js";import"./chunk-hrnx60em.js";import"./chunk-bbznk59q.js";import"./chunk-01gtn79f.js";import"./chunk-meaa7wrs.js";import"./chunk-gvj8qg7x.js";import"./chunk-fa03gsff.js";export{a as tui};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Cd as T,Ed as q,Fd as N,Gd as w,Hd as X,Kd as D}from"./chunk-9g05wsae.js";import"./chunk-x1dfc7qd.js";import{Sf as Q}from"./chunk-ntmn6epc.js";import{qh as A}from"./chunk-1qw3yh13.js";import"./chunk-ckhhm2m8.js";import"./chunk-tp7sfreh.js";import"./chunk-q6x5bmc3.js";import"./chunk-n1m5qdf5.js";import"./chunk-zeh3mjgp.js";import"./chunk-prrrw8t8.js";import"./chunk-tz8qhbk9.js";import"./chunk-k19zvbzh.js";import"./chunk-q39h31te.js";import{hl as $}from"./chunk-0x0a51w3.js";import"./chunk-7myavy3p.js";import"./chunk-fegrrsfj.js";import"./chunk-c4x99ayd.js";import"./chunk-w0fg8n1f.js";import"./chunk-0pbpzty2.js";import"./chunk-w8xaw2dv.js";import"./chunk-tq258v8s.js";import"./chunk-jc0wbpjq.js";import"./chunk-jfy6bfvv.js";import"./chunk-aej69zjj.js";import"./chunk-98nh88th.js";import"./chunk-t7v8wzr9.js";import"./chunk-er5q8nhp.js";import"./chunk-cqtkxwd8.js";import"./chunk-h6htvj2y.js";import"./chunk-2qy62cv4.js";import"./chunk-t2n6fmpy.js";import"./chunk-x1naayst.js";import"./chunk-ng85b73s.js";import"./chunk-351wfvhp.js";import"./chunk-hmm1m733.js";import"./chunk-k5vwx1nv.js";import"./chunk-ej3gmaba.js";import"./chunk-3nc9wy1m.js";import"./chunk-r8ddb02d.js";import"./chunk-dhvwrrqx.js";import"./chunk-56cty7nr.js";import"./chunk-thbjhgw0.js";import{ct as W}from"./chunk-v7yvnnmr.js";import{Gt as Y,vt as _}from"./chunk-b5x3zghc.js";import"./chunk-t1f7jeat.js";import"./chunk-tk6gjy9d.js";import"./chunk-pkdk0ppc.js";import"./chunk-hrnx60em.js";import"./chunk-bbznk59q.js";import"./chunk-01gtn79f.js";import"./chunk-meaa7wrs.js";import"./chunk-0ddhkapd.js";import"./chunk-gvj8qg7x.js";import"./chunk-fa03gsff.js";import V from"fs/promises";import L from"path";import R from"os";var g={command:"uninstall",describe:"uninstall qitqode and remove all related files",builder:(j)=>j.option("keep-config",{alias:"c",type:"boolean",describe:"keep configuration files",default:!1}).option("keep-data",{alias:"d",type:"boolean",describe:"keep session data and snapshots",default:!1}).option("dry-run",{type:"boolean",describe:"show what would be removed without removing",default:!1}).option("force",{alias:"f",type:"boolean",describe:"skip confirmation prompts",default:!1}),handler:async(j)=>{Q.empty(),Q.println(Q.logo(" ")),Q.empty(),w("Uninstall QitQode");let B=await A.runPromise($.Service.use((J)=>J.method()));N.info(`Installation method: ${B}`);let E=await v(j,B);if(await z(E,B),!j.force&&!j.dryRun){let J=await q({message:"Are you sure you want to uninstall?",initialValue:!1});if(!J||T(J)){X("Cancelled");return}}if(j.dryRun){N.warn("Dry run - no changes made"),X("Done");return}await G(B,E),X("Done")}};async function v(j,B){let E=[{path:W.Path.data,label:"Data",keep:j.keepData},{path:W.Path.cache,label:"Cache",keep:!1},{path:W.Path.config,label:"Config",keep:j.keepConfig},{path:W.Path.state,label:"State",keep:!1}],J=B==="curl"?await P():null,H=B==="curl"?process.execPath:null;return{directories:E,shellConfig:J,binary:H}}async function z(j,B){N.message("The following will be removed:");for(let E of j.directories){if(!await V.access(E.path).then(()=>!0).catch(()=>!1))continue;let H=await F(E.path),K=S(H),O=E.keep?Q.Style.TEXT_DIM+"(keeping)":"",M=E.keep?"\u25CB":"\u2713";N.info(` ${M} ${E.label}: ${Z(E.path)} ${Q.Style.TEXT_DIM}(${K})${O}`)}if(j.binary)N.info(` \u2713 Binary: ${Z(j.binary)}`);if(j.shellConfig)N.info(` \u2713 Shell PATH in ${Z(j.shellConfig)}`);if(B!=="curl"&&B!=="unknown"){let E={npm:"npm uninstall -g @qitqode/cli",pnpm:"pnpm uninstall -g @qitqode/cli",bun:"bun remove -g @qitqode/cli"};N.info(` \u2713 Package: ${E[B]||B}`)}}async function G(j,B){let E=D(),J=[];for(let H of B.directories){if(H.keep){N.step(`Skipping ${H.label} (--keep-${H.label.toLowerCase()})`);continue}if(!await V.access(H.path).then(()=>!0).catch(()=>!1))continue;E.start(`Removing ${H.label}...`);let O=await V.rm(H.path,{recursive:!0,force:!0}).catch((M)=>M);if(O){E.stop(`Failed to remove ${H.label}`,1),J.push(`${H.label}: ${O.message}`);continue}E.stop(`Removed ${H.label}`)}if(B.shellConfig){E.start("Cleaning shell config...");let H=await k(B.shellConfig).catch((K)=>K);if(H)E.stop("Failed to clean shell config",1),J.push(`Shell config: ${H.message}`);else E.stop("Cleaned shell config")}if(j!=="curl"&&j!=="unknown"){let K={npm:["npm","uninstall","-g","@qitqode/cli"],pnpm:["pnpm","uninstall","-g","@qitqode/cli"],bun:["bun","remove","-g","@qitqode/cli"]}[j];if(K){E.start(`Running ${K.join(" ")}...`);let O=await _.run(K,{nothrow:!0});if(O.code!==0)E.stop(`Package manager uninstall failed: exit code ${O.code}`,1),N.warn(`You may need to run manually: ${K.join(" ")}`);else E.stop("Package removed")}else N.warn(`Uninstall not supported for method "${j}" yet, skipping package removal`)}if(j==="curl"&&B.binary){Q.empty(),N.message("To finish removing the binary, run:"),N.info(` rm "${B.binary}"`);let H=L.dirname(B.binary);if(H.includes(".qitqode"))N.info(` rmdir "${H}" 2>/dev/null`)}if(J.length>0){Q.empty(),N.warn("Some operations failed:");for(let H of J)N.error(` ${H}`)}Q.empty(),N.success("Thank you for using QitQode!")}async function P(){let j=L.basename(process.env.SHELL||"bash"),B=R.homedir(),E=process.env.XDG_CONFIG_HOME||L.join(B,".config"),J={fish:[L.join(E,"fish","config.fish")],zsh:[L.join(B,".zshrc"),L.join(B,".zshenv"),L.join(E,"zsh",".zshrc"),L.join(E,"zsh",".zshenv")],bash:[L.join(B,".bashrc"),L.join(B,".bash_profile"),L.join(B,".profile"),L.join(E,"bash",".bashrc"),L.join(E,"bash",".bash_profile")],ash:[L.join(B,".ashrc"),L.join(B,".profile")],sh:[L.join(B,".profile")]},H=J[j]||J.bash;for(let K of H){if(!await V.access(K).then(()=>!0).catch(()=>!1))continue;let M=await Y.readText(K).catch(()=>"");if(M.includes("# qitqode")||M.includes(".qitqode/bin"))return K}return null}async function k(j){let E=(await Y.readText(j)).split(`
2
+ import{Cd as T,Ed as q,Fd as N,Gd as w,Hd as X,Kd as D}from"./chunk-9g05wsae.js";import"./chunk-x1dfc7qd.js";import{Sf as Q}from"./chunk-ntmn6epc.js";import{qh as A}from"./chunk-0jv8r99k.js";import"./chunk-th189x63.js";import"./chunk-k6eyc1wv.js";import"./chunk-q6x5bmc3.js";import"./chunk-n1m5qdf5.js";import"./chunk-zeh3mjgp.js";import"./chunk-prrrw8t8.js";import"./chunk-tz8qhbk9.js";import"./chunk-k19zvbzh.js";import"./chunk-3f6t3wde.js";import{hl as $}from"./chunk-b5h8vd5n.js";import"./chunk-jee9y4t0.js";import"./chunk-50aznc8e.js";import"./chunk-c4x99ayd.js";import"./chunk-73d0dy03.js";import"./chunk-ha5qct06.js";import"./chunk-w8xaw2dv.js";import"./chunk-tq258v8s.js";import"./chunk-ds162xgb.js";import"./chunk-jfy6bfvv.js";import"./chunk-2p6w3w8f.js";import"./chunk-98nh88th.js";import"./chunk-t7v8wzr9.js";import"./chunk-er5q8nhp.js";import"./chunk-cqtkxwd8.js";import"./chunk-h6htvj2y.js";import"./chunk-2qy62cv4.js";import"./chunk-t2n6fmpy.js";import"./chunk-x1naayst.js";import"./chunk-ng85b73s.js";import"./chunk-351wfvhp.js";import"./chunk-hmm1m733.js";import"./chunk-2bxy8zm1.js";import"./chunk-qq9pvscd.js";import"./chunk-3nc9wy1m.js";import"./chunk-r8ddb02d.js";import"./chunk-dhvwrrqx.js";import"./chunk-56cty7nr.js";import"./chunk-thbjhgw0.js";import{ct as W}from"./chunk-p20ft5mj.js";import{Gt as Y,vt as _}from"./chunk-b5x3zghc.js";import"./chunk-t1f7jeat.js";import"./chunk-tk6gjy9d.js";import"./chunk-pkdk0ppc.js";import"./chunk-hrnx60em.js";import"./chunk-bbznk59q.js";import"./chunk-01gtn79f.js";import"./chunk-meaa7wrs.js";import"./chunk-0ddhkapd.js";import"./chunk-gvj8qg7x.js";import"./chunk-fa03gsff.js";import V from"fs/promises";import L from"path";import R from"os";var g={command:"uninstall",describe:"uninstall qitqode and remove all related files",builder:(j)=>j.option("keep-config",{alias:"c",type:"boolean",describe:"keep configuration files",default:!1}).option("keep-data",{alias:"d",type:"boolean",describe:"keep session data and snapshots",default:!1}).option("dry-run",{type:"boolean",describe:"show what would be removed without removing",default:!1}).option("force",{alias:"f",type:"boolean",describe:"skip confirmation prompts",default:!1}),handler:async(j)=>{Q.empty(),Q.println(Q.logo(" ")),Q.empty(),w("Uninstall QitQode");let B=await A.runPromise($.Service.use((J)=>J.method()));N.info(`Installation method: ${B}`);let E=await v(j,B);if(await z(E,B),!j.force&&!j.dryRun){let J=await q({message:"Are you sure you want to uninstall?",initialValue:!1});if(!J||T(J)){X("Cancelled");return}}if(j.dryRun){N.warn("Dry run - no changes made"),X("Done");return}await G(B,E),X("Done")}};async function v(j,B){let E=[{path:W.Path.data,label:"Data",keep:j.keepData},{path:W.Path.cache,label:"Cache",keep:!1},{path:W.Path.config,label:"Config",keep:j.keepConfig},{path:W.Path.state,label:"State",keep:!1}],J=B==="curl"?await P():null,H=B==="curl"?process.execPath:null;return{directories:E,shellConfig:J,binary:H}}async function z(j,B){N.message("The following will be removed:");for(let E of j.directories){if(!await V.access(E.path).then(()=>!0).catch(()=>!1))continue;let H=await F(E.path),K=S(H),O=E.keep?Q.Style.TEXT_DIM+"(keeping)":"",M=E.keep?"\u25CB":"\u2713";N.info(` ${M} ${E.label}: ${Z(E.path)} ${Q.Style.TEXT_DIM}(${K})${O}`)}if(j.binary)N.info(` \u2713 Binary: ${Z(j.binary)}`);if(j.shellConfig)N.info(` \u2713 Shell PATH in ${Z(j.shellConfig)}`);if(B!=="curl"&&B!=="unknown"){let E={npm:"npm uninstall -g @qitqode/cli",pnpm:"pnpm uninstall -g @qitqode/cli",bun:"bun remove -g @qitqode/cli"};N.info(` \u2713 Package: ${E[B]||B}`)}}async function G(j,B){let E=D(),J=[];for(let H of B.directories){if(H.keep){N.step(`Skipping ${H.label} (--keep-${H.label.toLowerCase()})`);continue}if(!await V.access(H.path).then(()=>!0).catch(()=>!1))continue;E.start(`Removing ${H.label}...`);let O=await V.rm(H.path,{recursive:!0,force:!0}).catch((M)=>M);if(O){E.stop(`Failed to remove ${H.label}`,1),J.push(`${H.label}: ${O.message}`);continue}E.stop(`Removed ${H.label}`)}if(B.shellConfig){E.start("Cleaning shell config...");let H=await k(B.shellConfig).catch((K)=>K);if(H)E.stop("Failed to clean shell config",1),J.push(`Shell config: ${H.message}`);else E.stop("Cleaned shell config")}if(j!=="curl"&&j!=="unknown"){let K={npm:["npm","uninstall","-g","@qitqode/cli"],pnpm:["pnpm","uninstall","-g","@qitqode/cli"],bun:["bun","remove","-g","@qitqode/cli"]}[j];if(K){E.start(`Running ${K.join(" ")}...`);let O=await _.run(K,{nothrow:!0});if(O.code!==0)E.stop(`Package manager uninstall failed: exit code ${O.code}`,1),N.warn(`You may need to run manually: ${K.join(" ")}`);else E.stop("Package removed")}else N.warn(`Uninstall not supported for method "${j}" yet, skipping package removal`)}if(j==="curl"&&B.binary){Q.empty(),N.message("To finish removing the binary, run:"),N.info(` rm "${B.binary}"`);let H=L.dirname(B.binary);if(H.includes(".qitqode"))N.info(` rmdir "${H}" 2>/dev/null`)}if(J.length>0){Q.empty(),N.warn("Some operations failed:");for(let H of J)N.error(` ${H}`)}Q.empty(),N.success("Thank you for using QitQode!")}async function P(){let j=L.basename(process.env.SHELL||"bash"),B=R.homedir(),E=process.env.XDG_CONFIG_HOME||L.join(B,".config"),J={fish:[L.join(E,"fish","config.fish")],zsh:[L.join(B,".zshrc"),L.join(B,".zshenv"),L.join(E,"zsh",".zshrc"),L.join(E,"zsh",".zshenv")],bash:[L.join(B,".bashrc"),L.join(B,".bash_profile"),L.join(B,".profile"),L.join(E,"bash",".bashrc"),L.join(E,"bash",".bash_profile")],ash:[L.join(B,".ashrc"),L.join(B,".profile")],sh:[L.join(B,".profile")]},H=J[j]||J.bash;for(let K of H){if(!await V.access(K).then(()=>!0).catch(()=>!1))continue;let M=await Y.readText(K).catch(()=>"");if(M.includes("# qitqode")||M.includes(".qitqode/bin"))return K}return null}async function k(j){let E=(await Y.readText(j)).split(`
3
3
  `),J=[],H=!1;for(let O of E){let M=O.trim();if(M==="# qitqode"){H=!0;continue}if(H){if(H=!1,M.includes(".qitqode/bin")||M.includes("fish_add_path"))continue}if(M.startsWith("export PATH=")&&M.includes(".qitqode/bin")||M.startsWith("fish_add_path")&&M.includes(".qitqode"))continue;J.push(O)}while(J.length>0&&J[J.length-1].trim()==="")J.pop();let K=J.join(`
4
4
  `)+`
5
5
  `;await Y.write(j,K)}async function F(j){let B=0,E=async(J)=>{let H=await V.readdir(J,{withFileTypes:!0}).catch(()=>[]);for(let K of H){let O=L.join(J,K.name);if(K.isDirectory()){await E(O);continue}if(K.isFile()){let M=await V.stat(O).catch(()=>null);if(M)B+=M.size}}};return await E(j),B}function S(j){if(j<1024)return`${j} B`;if(j<1048576)return`${(j/1024).toFixed(1)} KB`;if(j<1073741824)return`${(j/1048576).toFixed(1)} MB`;return`${(j/1073741824).toFixed(1)} GB`}function Z(j){let B=R.homedir();if(j===B||j.startsWith(B+L.sep))return"~"+j.slice(B.length);return j}export{g as UninstallCommand};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Cd as y,Ed as T,Fd as t,Gd as O,Hd as l,Jd as v,Kd as Q,Ld as X,Md as J}from"./chunk-9g05wsae.js";import"./chunk-x1dfc7qd.js";import{Od as w}from"./chunk-wmmck56g.js";import{Sf as f}from"./chunk-ntmn6epc.js";import{Lg as Y,Mg as mt,Ng as pt,Og as st,Pg as et,Qg as ft,Rg as E,qh as q}from"./chunk-1qw3yh13.js";import{sh as Mt}from"./chunk-ckhhm2m8.js";import"./chunk-tp7sfreh.js";import"./chunk-q6x5bmc3.js";import"./chunk-n1m5qdf5.js";import"./chunk-zeh3mjgp.js";import"./chunk-prrrw8t8.js";import"./chunk-tz8qhbk9.js";import"./chunk-k19zvbzh.js";import{Cj as nt,Jj as L,fl as F}from"./chunk-q39h31te.js";import"./chunk-0x0a51w3.js";import{Pl as $}from"./chunk-7myavy3p.js";import"./chunk-fegrrsfj.js";import"./chunk-c4x99ayd.js";import"./chunk-w0fg8n1f.js";import{Lo as P,Mo as h}from"./chunk-0pbpzty2.js";import"./chunk-w8xaw2dv.js";import"./chunk-tq258v8s.js";import"./chunk-jc0wbpjq.js";import"./chunk-jfy6bfvv.js";import"./chunk-aej69zjj.js";import"./chunk-98nh88th.js";import"./chunk-t7v8wzr9.js";import"./chunk-er5q8nhp.js";import"./chunk-cqtkxwd8.js";import"./chunk-h6htvj2y.js";import"./chunk-2qy62cv4.js";import"./chunk-t2n6fmpy.js";import"./chunk-x1naayst.js";import"./chunk-ng85b73s.js";import"./chunk-351wfvhp.js";import"./chunk-hmm1m733.js";import"./chunk-k5vwx1nv.js";import"./chunk-ej3gmaba.js";import"./chunk-3nc9wy1m.js";import"./chunk-r8ddb02d.js";import"./chunk-dhvwrrqx.js";import"./chunk-56cty7nr.js";import"./chunk-thbjhgw0.js";import{Gs as g,ct as A}from"./chunk-v7yvnnmr.js";import{Gt as D}from"./chunk-b5x3zghc.js";import"./chunk-t1f7jeat.js";import"./chunk-tk6gjy9d.js";import"./chunk-pkdk0ppc.js";import"./chunk-hrnx60em.js";import"./chunk-bbznk59q.js";import"./chunk-01gtn79f.js";import{$H as a}from"./chunk-meaa7wrs.js";import"./chunk-0ddhkapd.js";import"./chunk-gvj8qg7x.js";import{lP as ut}from"./chunk-fa03gsff.js";import W from"path";function G(o){switch(o){case"authenticated":return"\u2713";case"expired":return"\u26A0";case"not_authenticated":return"\u2717"}}function H(o){switch(o){case"authenticated":return"authenticated";case"expired":return"expired";case"not_authenticated":return"not authenticated"}}function N(o){return typeof o==="object"&&o!==null&&"type"in o}function k(o){return N(o)&&o.type==="remote"}function B(o){return Object.entries(o.mcp??{}).filter((e)=>N(e[1]))}function U(o,e){let r=o.mcp_origins?.[e];if(!r)return"qitqode";let i=A.Path.home,m=r.source===i?"~":r.source.startsWith(i+W.sep)?"~"+r.source.slice(i.length):r.source;return`${r.type}:${m}`}function C(o){return B(o).filter((e)=>k(e[1])&&e[1].oauth!==!1)}async function I(){return q.runPromise(a.gen(function*(){let o=yield*F.Service,e=yield*E.Service,r=yield*o.get(),i=yield*e.status(),m=yield*a.all(Object.fromEntries(B(r).map(([p])=>[p,e.hasStoredTokens(p)])),{concurrency:"unbounded"});return{config:r,statuses:i,stored:m}}))}async function S(){return q.runPromise(a.gen(function*(){let o=yield*F.Service,e=yield*E.Service,r=yield*o.get(),i=yield*a.all(Object.fromEntries(C(r).map(([m])=>[m,e.getAuthStatus(m)])),{concurrency:"unbounded"});return{config:r,auth:i}}))}async function V(o,e=!1){let r=[W.join(o,"qitqode.json"),W.join(o,"qitqode.jsonc")];if(!e)r.push(W.join(o,".qitqode","qitqode.json"),W.join(o,".qitqode","qitqode.jsonc"));for(let i of r)if(await D.exists(i))return i;return r[0]}async function R(o,e,r){let i="{}";if(await D.exists(r))i=await D.readText(r);let m=P(i,["mcp",o],e,{formattingOptions:{tabSize:2,insertSpaces:!0}});return await D.write(r,h(i,m)),r}var tt=ut(Mt(),1);function yt(o){let e=tt.parse(o);if(!e.every((r)=>typeof r==="string"))throw Error("Shell operators are not supported; enter only the command and its arguments");if(e.length===0)throw Error("Command is required");return e}var ot=w({command:"add",describe:"add an MCP server",async handler(){await $.provide({directory:process.cwd(),async fn(){f.empty(),O("Add MCP server");let o=$.project,[e,r]=await Promise.all([V($.worktree),V(A.Path.config,!0)]),i=r;if(o.vcs==="git"){let c=await X({message:"Location",options:[{label:"Current project",value:e,hint:e},{label:"Global",value:r,hint:r}]});if(y(c))throw new f.CancelledError;i=c}let m=await J({message:"Enter MCP server name",validate:(c)=>c&&c.length>0?void 0:"Required"});if(y(m))throw new f.CancelledError;let p=await X({message:"Select MCP server type",options:[{label:"Local",value:"local",hint:"Run a local command"},{label:"Remote",value:"remote",hint:"Connect to a remote URL"}]});if(y(p))throw new f.CancelledError;if(p==="local"){let c=await J({message:"Enter command to run",placeholder:"e.g., qode x @modelcontextprotocol/server-filesystem",validate:(s)=>s&&s.length>0?void 0:"Required"});if(y(c))throw new f.CancelledError;let u;try{u=yt(c)}catch(s){t.error(s instanceof Error?s.message:"Invalid command"),l("MCP server was not added");return}await R(m,{type:"local",command:u},i),t.success(`MCP server "${m}" added to ${i}`),l("MCP server added successfully");return}if(p==="remote"){let c=await J({message:"Enter MCP server URL",placeholder:"e.g., https://example.com/mcp",validate:(s)=>{if(!s)return"Required";if(s.length===0)return"Required";return URL.canParse(s)?void 0:"Invalid URL"}});if(y(c))throw new f.CancelledError;let u=await T({message:"Does this server require OAuth authentication?",initialValue:!1});if(y(u))throw new f.CancelledError;let n;if(u){let s=await T({message:"Do you have a pre-registered client ID?",initialValue:!1});if(y(s))throw new f.CancelledError;if(s){let d=await J({message:"Enter client ID",validate:(j)=>j&&j.length>0?void 0:"Required"});if(y(d))throw new f.CancelledError;let M=await T({message:"Do you have a client secret?",initialValue:!1});if(y(M))throw new f.CancelledError;let _;if(M){let j=await v({message:"Enter client secret"});if(y(j))throw new f.CancelledError;_=j}n={type:"remote",url:c,oauth:{clientId:d,..._&&{clientSecret:_}}}}else n={type:"remote",url:c,oauth:{}}}else n={type:"remote",url:c,oauth:!1};await R(m,n,i),t.success(`MCP server "${m}" added to ${i}`)}l("MCP server added successfully")}})}});var it=w({command:"list",aliases:["ls"],describe:"list MCP servers and their status",async handler(){await $.provide({directory:process.cwd(),async fn(){f.empty(),O("MCP Servers");let{config:o,statuses:e,stored:r}=await I(),i=B(o);if(i.length===0){t.warn("No MCP servers configured"),l("Add servers with: qode mcp add");return}for(let[m,p]of i){let c=e[m],u=k(p)&&p.oauth!==!1,n=r[m],s,d,M="";if(!c)s="\u25CB",d="not initialized";else if(c.status==="connected"){if(s="\u2713",d="connected",u&&n)M=" (OAuth)"}else if(c.status==="disabled")s="\u25CB",d="disabled";else if(c.status==="pending")s="\u25CB",d="pending approval";else if(c.status==="needs_auth")s="\u26A0",d="needs authentication";else if(c.status==="needs_client_registration")s="\u2717",d="needs client registration",M=`
2
+ import{Cd as y,Ed as T,Fd as t,Gd as O,Hd as l,Jd as v,Kd as Q,Ld as X,Md as J}from"./chunk-9g05wsae.js";import"./chunk-x1dfc7qd.js";import{Od as w}from"./chunk-wmmck56g.js";import{Sf as f}from"./chunk-ntmn6epc.js";import{Lg as Y,Mg as mt,Ng as pt,Og as st,Pg as et,Qg as ft,Rg as E,qh as q}from"./chunk-0jv8r99k.js";import{sh as Mt}from"./chunk-th189x63.js";import"./chunk-k6eyc1wv.js";import"./chunk-q6x5bmc3.js";import"./chunk-n1m5qdf5.js";import"./chunk-zeh3mjgp.js";import"./chunk-prrrw8t8.js";import"./chunk-tz8qhbk9.js";import"./chunk-k19zvbzh.js";import{Cj as nt,Jj as L,fl as F}from"./chunk-3f6t3wde.js";import"./chunk-b5h8vd5n.js";import{Pl as $}from"./chunk-jee9y4t0.js";import"./chunk-50aznc8e.js";import"./chunk-c4x99ayd.js";import"./chunk-73d0dy03.js";import{Lo as P,Mo as h}from"./chunk-ha5qct06.js";import"./chunk-w8xaw2dv.js";import"./chunk-tq258v8s.js";import"./chunk-ds162xgb.js";import"./chunk-jfy6bfvv.js";import"./chunk-2p6w3w8f.js";import"./chunk-98nh88th.js";import"./chunk-t7v8wzr9.js";import"./chunk-er5q8nhp.js";import"./chunk-cqtkxwd8.js";import"./chunk-h6htvj2y.js";import"./chunk-2qy62cv4.js";import"./chunk-t2n6fmpy.js";import"./chunk-x1naayst.js";import"./chunk-ng85b73s.js";import"./chunk-351wfvhp.js";import"./chunk-hmm1m733.js";import"./chunk-2bxy8zm1.js";import"./chunk-qq9pvscd.js";import"./chunk-3nc9wy1m.js";import"./chunk-r8ddb02d.js";import"./chunk-dhvwrrqx.js";import"./chunk-56cty7nr.js";import"./chunk-thbjhgw0.js";import{Gs as g,ct as A}from"./chunk-p20ft5mj.js";import{Gt as D}from"./chunk-b5x3zghc.js";import"./chunk-t1f7jeat.js";import"./chunk-tk6gjy9d.js";import"./chunk-pkdk0ppc.js";import"./chunk-hrnx60em.js";import"./chunk-bbznk59q.js";import"./chunk-01gtn79f.js";import{$H as a}from"./chunk-meaa7wrs.js";import"./chunk-0ddhkapd.js";import"./chunk-gvj8qg7x.js";import{lP as ut}from"./chunk-fa03gsff.js";import W from"path";function G(o){switch(o){case"authenticated":return"\u2713";case"expired":return"\u26A0";case"not_authenticated":return"\u2717"}}function H(o){switch(o){case"authenticated":return"authenticated";case"expired":return"expired";case"not_authenticated":return"not authenticated"}}function N(o){return typeof o==="object"&&o!==null&&"type"in o}function k(o){return N(o)&&o.type==="remote"}function B(o){return Object.entries(o.mcp??{}).filter((e)=>N(e[1]))}function U(o,e){let r=o.mcp_origins?.[e];if(!r)return"qitqode";let i=A.Path.home,m=r.source===i?"~":r.source.startsWith(i+W.sep)?"~"+r.source.slice(i.length):r.source;return`${r.type}:${m}`}function C(o){return B(o).filter((e)=>k(e[1])&&e[1].oauth!==!1)}async function I(){return q.runPromise(a.gen(function*(){let o=yield*F.Service,e=yield*E.Service,r=yield*o.get(),i=yield*e.status(),m=yield*a.all(Object.fromEntries(B(r).map(([p])=>[p,e.hasStoredTokens(p)])),{concurrency:"unbounded"});return{config:r,statuses:i,stored:m}}))}async function S(){return q.runPromise(a.gen(function*(){let o=yield*F.Service,e=yield*E.Service,r=yield*o.get(),i=yield*a.all(Object.fromEntries(C(r).map(([m])=>[m,e.getAuthStatus(m)])),{concurrency:"unbounded"});return{config:r,auth:i}}))}async function V(o,e=!1){let r=[W.join(o,"qitqode.json"),W.join(o,"qitqode.jsonc")];if(!e)r.push(W.join(o,".qitqode","qitqode.json"),W.join(o,".qitqode","qitqode.jsonc"));for(let i of r)if(await D.exists(i))return i;return r[0]}async function R(o,e,r){let i="{}";if(await D.exists(r))i=await D.readText(r);let m=P(i,["mcp",o],e,{formattingOptions:{tabSize:2,insertSpaces:!0}});return await D.write(r,h(i,m)),r}var tt=ut(Mt(),1);function yt(o){let e=tt.parse(o);if(!e.every((r)=>typeof r==="string"))throw Error("Shell operators are not supported; enter only the command and its arguments");if(e.length===0)throw Error("Command is required");return e}var ot=w({command:"add",describe:"add an MCP server",async handler(){await $.provide({directory:process.cwd(),async fn(){f.empty(),O("Add MCP server");let o=$.project,[e,r]=await Promise.all([V($.worktree),V(A.Path.config,!0)]),i=r;if(o.vcs==="git"){let c=await X({message:"Location",options:[{label:"Current project",value:e,hint:e},{label:"Global",value:r,hint:r}]});if(y(c))throw new f.CancelledError;i=c}let m=await J({message:"Enter MCP server name",validate:(c)=>c&&c.length>0?void 0:"Required"});if(y(m))throw new f.CancelledError;let p=await X({message:"Select MCP server type",options:[{label:"Local",value:"local",hint:"Run a local command"},{label:"Remote",value:"remote",hint:"Connect to a remote URL"}]});if(y(p))throw new f.CancelledError;if(p==="local"){let c=await J({message:"Enter command to run",placeholder:"e.g., qode x @modelcontextprotocol/server-filesystem",validate:(s)=>s&&s.length>0?void 0:"Required"});if(y(c))throw new f.CancelledError;let u;try{u=yt(c)}catch(s){t.error(s instanceof Error?s.message:"Invalid command"),l("MCP server was not added");return}await R(m,{type:"local",command:u},i),t.success(`MCP server "${m}" added to ${i}`),l("MCP server added successfully");return}if(p==="remote"){let c=await J({message:"Enter MCP server URL",placeholder:"e.g., https://example.com/mcp",validate:(s)=>{if(!s)return"Required";if(s.length===0)return"Required";return URL.canParse(s)?void 0:"Invalid URL"}});if(y(c))throw new f.CancelledError;let u=await T({message:"Does this server require OAuth authentication?",initialValue:!1});if(y(u))throw new f.CancelledError;let n;if(u){let s=await T({message:"Do you have a pre-registered client ID?",initialValue:!1});if(y(s))throw new f.CancelledError;if(s){let d=await J({message:"Enter client ID",validate:(j)=>j&&j.length>0?void 0:"Required"});if(y(d))throw new f.CancelledError;let M=await T({message:"Do you have a client secret?",initialValue:!1});if(y(M))throw new f.CancelledError;let _;if(M){let j=await v({message:"Enter client secret"});if(y(j))throw new f.CancelledError;_=j}n={type:"remote",url:c,oauth:{clientId:d,..._&&{clientSecret:_}}}}else n={type:"remote",url:c,oauth:{}}}else n={type:"remote",url:c,oauth:!1};await R(m,n,i),t.success(`MCP server "${m}" added to ${i}`)}l("MCP server added successfully")}})}});var it=w({command:"list",aliases:["ls"],describe:"list MCP servers and their status",async handler(){await $.provide({directory:process.cwd(),async fn(){f.empty(),O("MCP Servers");let{config:o,statuses:e,stored:r}=await I(),i=B(o);if(i.length===0){t.warn("No MCP servers configured"),l("Add servers with: qode mcp add");return}for(let[m,p]of i){let c=e[m],u=k(p)&&p.oauth!==!1,n=r[m],s,d,M="";if(!c)s="\u25CB",d="not initialized";else if(c.status==="connected"){if(s="\u2713",d="connected",u&&n)M=" (OAuth)"}else if(c.status==="disabled")s="\u25CB",d="disabled";else if(c.status==="pending")s="\u25CB",d="pending approval";else if(c.status==="needs_auth")s="\u26A0",d="needs authentication";else if(c.status==="needs_client_registration")s="\u2717",d="needs client registration",M=`
3
3
  `+c.error;else s="\u2717",d="failed",M=`
4
4
  `+c.error;let _=p.type==="remote"?L.redactString(p.url):L.redactCommand(p.command).join(" ");t.info(`${s} ${m} ${f.Style.TEXT_DIM}${d} ${U(o,m)}${M}
5
5
  ${f.Style.TEXT_DIM}${_}`)}l(`${i.length} server(s)`)}})}});var dt=w({command:"auth [name]",describe:"authenticate with an OAuth-enabled MCP server",builder:(o)=>o.positional("name",{describe:"name of the MCP server",type:"string"}).command(ct),async handler(o){await $.provide({directory:process.cwd(),async fn(){f.empty(),O("MCP OAuth Authentication");let{config:e,auth:r}=await S(),i=e.mcp??{},m=C(e);if(m.length===0){t.warn("No OAuth-capable MCP servers configured"),t.info("Remote MCP servers support OAuth by default. Add a remote server in qitqode.json:"),t.info(`
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{sp as a}from"./chunk-aej69zjj.js";import"./chunk-dhvwrrqx.js";import"./chunk-v7yvnnmr.js";import"./chunk-b5x3zghc.js";import"./chunk-t1f7jeat.js";import"./chunk-tk6gjy9d.js";import"./chunk-pkdk0ppc.js";import"./chunk-hrnx60em.js";import"./chunk-bbznk59q.js";import"./chunk-01gtn79f.js";import"./chunk-meaa7wrs.js";import"./chunk-fa03gsff.js";export{a as which};
2
+ import{sp as a}from"./chunk-2p6w3w8f.js";import"./chunk-dhvwrrqx.js";import"./chunk-p20ft5mj.js";import"./chunk-b5x3zghc.js";import"./chunk-t1f7jeat.js";import"./chunk-tk6gjy9d.js";import"./chunk-pkdk0ppc.js";import"./chunk-hrnx60em.js";import"./chunk-bbznk59q.js";import"./chunk-01gtn79f.js";import"./chunk-meaa7wrs.js";import"./chunk-fa03gsff.js";export{a as which};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Nj as s,Sj as e,Tj as j,Uj as v,ek as u,fk as f}from"./chunk-q39h31te.js";import{Fl as D,Jl as b,Kl as a,Ll as t,wl as r,xl as C,yl as k,zl as m}from"./chunk-7myavy3p.js";import{cn as x,dn as q,fn as n,gn as o,in as K,kn as c,rn as i}from"./chunk-c4x99ayd.js";import{ct as O_,mt as Q_}from"./chunk-v7yvnnmr.js";import{Bt as d,Gt as g}from"./chunk-b5x3zghc.js";import{nP as S_}from"./chunk-fa03gsff.js";var l={};S_(l,{run:()=>h_,encodeDir:()=>k_,ClaudeImport:()=>l});import E_ from"path";import W_ from"path";import{access as X_,readFile as Y_}from"fs/promises";var G=n("external_import",{source:q().$type().notNull(),source_key:q().notNull(),session_id:q().$type().notNull(),source_path:q().notNull(),source_mtime:x().notNull(),time_imported:x().notNull(),message_ids:q({mode:"json"}).$type()},(N)=>[o({columns:[N.source,N.source_key]})]);function Z_(){return{scanned:0,imported:0,resynced:0,skipped:0,errors:[]}}async function L_(N){if(!N||!await g.exists(N))return{id:b.global,worktree:N||"/",vcs:null};if(!await a(N))return{id:b.global,worktree:N,vcs:null};return{id:await t(N),worktree:N,vcs:"git"}}function __(N){return N.split(`
2
+ import{Nj as s,Sj as e,Tj as j,Uj as v,ek as u,fk as f}from"./chunk-3f6t3wde.js";import{Fl as D,Jl as b,Kl as a,Ll as t,wl as r,xl as C,yl as k,zl as m}from"./chunk-jee9y4t0.js";import{cn as x,dn as q,fn as n,gn as o,in as K,kn as c,rn as i}from"./chunk-c4x99ayd.js";import{ct as O_,mt as Q_}from"./chunk-p20ft5mj.js";import{Bt as d,Gt as g}from"./chunk-b5x3zghc.js";import{nP as S_}from"./chunk-fa03gsff.js";var l={};S_(l,{run:()=>h_,encodeDir:()=>k_,ClaudeImport:()=>l});import E_ from"path";import W_ from"path";import{access as X_,readFile as Y_}from"fs/promises";var G=n("external_import",{source:q().$type().notNull(),source_key:q().notNull(),session_id:q().$type().notNull(),source_path:q().notNull(),source_mtime:x().notNull(),time_imported:x().notNull(),message_ids:q({mode:"json"}).$type()},(N)=>[o({columns:[N.source,N.source_key]})]);function Z_(){return{scanned:0,imported:0,resynced:0,skipped:0,errors:[]}}async function L_(N){if(!N||!await g.exists(N))return{id:b.global,worktree:N||"/",vcs:null};if(!await a(N))return{id:b.global,worktree:N,vcs:null};return{id:await t(N),worktree:N,vcs:"git"}}function __(N){return N.split(`
3
3
  `).map((_)=>_.trim()).filter(Boolean).flatMap((_)=>{try{return[JSON.parse(_)]}catch{return[]}})}function N_(N){let _=N.find((H)=>H.trim()&&!H.trim().startsWith("<"));if(!_)return;return _.trim().replace(/\s+/g," ").slice(0,100)}function R_(N,_){return D.use((H)=>H.select().from(G).where(c(K(G.source,N),K(G.source_key,_))).get())}function G_(N,_){if(!_)return{existing:void 0,existingUpdated:void 0};let H=_,O=D.use((Z)=>Z.select({updated:C.time_updated}).from(C).where(K(C.id,H.session_id)).get());if(!O)return D.use((Z)=>Z.delete(G).where(c(K(G.source,N),K(G.source_key,H.source_key))).run()),{existing:void 0,existingUpdated:void 0};return{existing:_,existingUpdated:O.updated}}function J_(N,_,H,O){N.insert(r).values({id:_.id,worktree:_.worktree,vcs:_.vcs,sandboxes:[],time_created:H,time_updated:O}).onConflictDoNothing().run()}function K_(N,_,H){if(_.message_ids?.length)for(let O=0;O<_.message_ids.length;O+=500)N.delete(k).where(i(k.id,_.message_ids.slice(O,O+500))).run();else N.delete(k).where(K(k.session_id,H)).run()}function A_(N,_,H){N.update(C).set({project_id:H.projectId,directory:H.directory,version:H.version,time_updated:Math.max(H.existingUpdated??0,H.timeUpdated)}).where(K(C.id,_)).run()}function $_(N){return async(_)=>F_({...N,force:_?.force})}async function F_(N){let _=Z_();if(!await X_(N.root).then(()=>!0).catch(()=>!1))return _;let H=await d.scan(N.pattern,{cwd:N.root,absolute:!0});for(let O of H){_.scanned++;try{let Z=W_.basename(O,".jsonl"),A=await g.statAsync(O);if(!A){_.skipped++;continue}let F=Math.floor(Number(A.mtimeMs)),Y=R_(N.source,Z);if(Y&&Y.source_mtime===F&&!N.force){_.skipped++;continue}let S=G_(N.source,Y);Y=S.existing;let T=S.existingUpdated,Q=Y?Y.session_id:e.descending(),V=N.parse(await Y_(O,"utf-8"),Q);if(!V||V.messages.length===0){_.skipped++;continue}let E=await L_(V.cwd),U=Date.now(),X=V.messages.map(($)=>$.info.id);if(D.transaction(($)=>{if(J_($,E,V.timeCreated,V.timeUpdated),Y)K_($,Y,Q),A_($,Q,{projectId:E.id,directory:V.cwd,version:V.version,existingUpdated:T,timeUpdated:V.timeUpdated});else $.insert(C).values({id:Q,project_id:E.id,slug:s.create(),directory:V.cwd,title:V.title,version:V.version,time_created:V.timeCreated,time_updated:V.timeUpdated}).run();for(let L of V.messages){let{id:B,sessionID:I,agentID:w,...z}=L.info;$.insert(k).values({id:B,session_id:Q,agent_id:"main",time_created:L.info.time.created,data:z}).onConflictDoUpdate({target:k.id,set:{data:z}}).run();for(let J of L.parts){let{id:y,sessionID:p,messageID:P,...h}=J.part;$.insert(m).values({id:y,message_id:L.info.id,session_id:Q,time_created:J.time,data:h}).onConflictDoUpdate({target:m.id,set:{data:h}}).run()}}$.insert(G).values({source:N.source,source_key:Z,session_id:Q,source_path:O,source_mtime:F,time_imported:U,message_ids:X}).onConflictDoUpdate({target:[G.source,G.source_key],set:{session_id:Q,source_path:O,source_mtime:F,time_imported:U,message_ids:X}}).run()}),Y)_.resynced++;else _.imported++}catch(Z){_.errors.push(`${O}: ${Z}`)}}if(_.imported+_.resynced>0||_.errors.length>0)N.log.info(N.logMessage,{..._,errors:_.errors.length});return _}var B_=Q_.create({service:"claude-import"});function k_(N){return N.replace(/[^a-zA-Z0-9]/g,"-")}function z_(N){if(!N)return{providerID:u.anthropic,modelID:f.make("unknown")};let _=N.indexOf("/");if(_===-1)return{providerID:u.anthropic,modelID:f.make(N)};return{providerID:u.make(N.slice(0,_)),modelID:f.make(N.slice(_+1))}}function H_(N){let _=N??{};return{input:_.input_tokens??0,output:_.output_tokens??0,reasoning:0,cache:{read:_.cache_read_input_tokens??0,write:_.cache_creation_input_tokens??0}}}function C_(N){if(typeof N==="string")return N;if(Array.isArray(N))return N.map((_)=>_&&typeof _==="object"&&("type"in _)&&_.type==="text"?_.text:JSON.stringify(_)).join(`
4
4
  `);return N==null?"":JSON.stringify(N)}function U_(N,_){let H=__(N);if(H.length===0)return;let O,Z,A,F=0,Y,S=[],T=new Map,Q=null,V=null,E=z_(void 0),U=()=>{if(Q)S.push(Q);Q=null};for(let X of H){if(X.type!=="user"&&X.type!=="assistant")continue;let $=X.timestamp?Date.parse(X.timestamp):Date.now();if(!O&&X.cwd)O=X.cwd;if(!Z&&X.version)Z=X.version;if(A===void 0)A=$;F=Math.max(F,$);let L=X.message;if(!L)continue;if(X.type==="user"){let z=L.content,J=typeof z==="string"?[]:Array.isArray(z)?z:[];for(let W of J.filter((R)=>R?.type==="tool_result")){let R=T.get(W.tool_use_id);if(!R)continue;let M=C_(W.content);R.part.state=W.is_error?{status:"error",input:R.part.state.input??{},error:M,time:{start:R.start,end:$}}:{status:"completed",input:R.part.state.input??{},output:M,title:R.part.tool,metadata:{},time:{start:R.start,end:$}}}let y=typeof z==="string"?z.trim()?[z]:[]:J.filter((W)=>W?.type==="text"&&typeof W.text==="string"&&W.text.trim()).map((W)=>W.text),p=J.filter((W)=>W?.type==="image"&&W.source);if(y.length===0&&p.length===0)continue;U();let P=j.ascending(),h=[];for(let W of y)h.push({part:{id:v.ascending(),sessionID:_,messageID:P,type:"text",text:W},time:$});for(let W of p){let R=W.source.media_type??"image/png",M=W.source.type==="base64"?`data:${R};base64,${W.source.data}`:W.source.url??"";if(M)h.push({part:{id:v.ascending(),sessionID:_,messageID:P,type:"file",mime:R,url:M},time:$})}let V_={id:P,sessionID:_,role:"user",agent:"main",time:{created:$},model:{providerID:E.providerID,modelID:E.modelID}};if(S.push({info:V_,parts:h}),V=P,!Y)Y=N_(y);continue}let B=z_(L.model);if(E=B,!V){let z=j.ascending();S.push({info:{id:z,sessionID:_,role:"user",agent:"main",time:{created:$},model:{providerID:B.providerID,modelID:B.modelID}},parts:[]}),V=z}if(!Q||Q.info.role!=="assistant"||Q.info.parentID!==V)U(),Q={info:{id:j.ascending(),sessionID:_,role:"assistant",time:{created:$,completed:$},parentID:V,modelID:B.modelID,providerID:B.providerID,mode:"build",agent:"main",path:{cwd:O??X.cwd??"",root:O??X.cwd??""},cost:0,tokens:H_(L.usage)},parts:[]};let I=Q.info;I.time.completed=$,I.tokens=H_(L.usage);let w=Q.info.id;for(let z of Array.isArray(L.content)?L.content:[])if(z?.type==="thinking"||z?.type==="reasoning")Q.parts.push({part:{id:v.ascending(),sessionID:_,messageID:w,type:"reasoning",text:z.thinking??z.text??"",time:{start:$,end:$}},time:$});else if(z?.type==="text"&&typeof z.text==="string")Q.parts.push({part:{id:v.ascending(),sessionID:_,messageID:w,type:"text",text:z.text},time:$});else if(z?.type==="tool_use"){let J={id:v.ascending(),sessionID:_,messageID:w,type:"tool",callID:z.id,tool:z.name,state:{status:"pending",input:z.input??{},raw:JSON.stringify(z.input??{})}};Q.parts.push({part:J,time:$}),T.set(z.id,{part:J,start:$})}}return U(),{cwd:O??"",version:Z??"claude-code",title:Y??"Claude Code session",timeCreated:A??Date.now(),timeUpdated:F||A||Date.now(),messages:S}}var h_=$_({source:"cc",root:E_.join(O_.Path.home,".claude","projects"),pattern:"*/*.jsonl",log:B_,logMessage:"claude import",parse:U_});
5
5
  export{G as _f,Z_ as $f,L_ as ag,__ as bg,N_ as cg,R_ as dg,G_ as eg,J_ as fg,K_ as gg,A_ as hg,$_ as ig,k_ as jg,h_ as kg,l as lg};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Vf as a,Wf as b,Xf as c,Yf as d,Zf as e}from"./chunk-qq48ffjc.js";import"./chunk-rmmrnx95.js";import"./chunk-5549c7mb.js";import"./chunk-pn77fh9b.js";import"./chunk-hkqcpdmt.js";import"./chunk-nfg7nt13.js";import"./chunk-awdpkgxf.js";import"./chunk-xb031er5.js";import"./chunk-1qw3yh13.js";import"./chunk-ckhhm2m8.js";import"./chunk-tp7sfreh.js";import"./chunk-q6x5bmc3.js";import"./chunk-n1m5qdf5.js";import"./chunk-zeh3mjgp.js";import"./chunk-prrrw8t8.js";import"./chunk-tz8qhbk9.js";import"./chunk-k19zvbzh.js";import"./chunk-q39h31te.js";import"./chunk-0x0a51w3.js";import"./chunk-7myavy3p.js";import"./chunk-fegrrsfj.js";import"./chunk-c4x99ayd.js";import"./chunk-w0fg8n1f.js";import"./chunk-0pbpzty2.js";import"./chunk-w8xaw2dv.js";import"./chunk-tq258v8s.js";import"./chunk-jc0wbpjq.js";import"./chunk-jfy6bfvv.js";import"./chunk-aej69zjj.js";import"./chunk-98nh88th.js";import"./chunk-t7v8wzr9.js";import"./chunk-er5q8nhp.js";import"./chunk-cqtkxwd8.js";import"./chunk-h6htvj2y.js";import"./chunk-2qy62cv4.js";import"./chunk-t2n6fmpy.js";import"./chunk-x1naayst.js";import"./chunk-ng85b73s.js";import"./chunk-351wfvhp.js";import"./chunk-hmm1m733.js";import"./chunk-k5vwx1nv.js";import"./chunk-ej3gmaba.js";import"./chunk-3nc9wy1m.js";import"./chunk-r8ddb02d.js";import"./chunk-dhvwrrqx.js";import"./chunk-56cty7nr.js";import"./chunk-thbjhgw0.js";import"./chunk-v7yvnnmr.js";import"./chunk-b5x3zghc.js";import"./chunk-t1f7jeat.js";import"./chunk-tk6gjy9d.js";import"./chunk-pkdk0ppc.js";import"./chunk-hrnx60em.js";import"./chunk-bbznk59q.js";import"./chunk-01gtn79f.js";import"./chunk-meaa7wrs.js";import"./chunk-0ddhkapd.js";import"./chunk-gvj8qg7x.js";import"./chunk-fa03gsff.js";export{c as url,b as openapi,d as listen,e as Server,a as Default};
2
+ import{Vf as a,Wf as b,Xf as c,Yf as d,Zf as e}from"./chunk-h5wh2d49.js";import"./chunk-xjdxyeja.js";import"./chunk-1zb95qfx.js";import"./chunk-cckshvkb.js";import"./chunk-hkqcpdmt.js";import"./chunk-nfg7nt13.js";import"./chunk-awdpkgxf.js";import"./chunk-8x6x3g16.js";import"./chunk-0jv8r99k.js";import"./chunk-th189x63.js";import"./chunk-k6eyc1wv.js";import"./chunk-q6x5bmc3.js";import"./chunk-n1m5qdf5.js";import"./chunk-zeh3mjgp.js";import"./chunk-prrrw8t8.js";import"./chunk-tz8qhbk9.js";import"./chunk-k19zvbzh.js";import"./chunk-3f6t3wde.js";import"./chunk-b5h8vd5n.js";import"./chunk-jee9y4t0.js";import"./chunk-50aznc8e.js";import"./chunk-c4x99ayd.js";import"./chunk-73d0dy03.js";import"./chunk-ha5qct06.js";import"./chunk-w8xaw2dv.js";import"./chunk-tq258v8s.js";import"./chunk-ds162xgb.js";import"./chunk-jfy6bfvv.js";import"./chunk-2p6w3w8f.js";import"./chunk-98nh88th.js";import"./chunk-t7v8wzr9.js";import"./chunk-er5q8nhp.js";import"./chunk-cqtkxwd8.js";import"./chunk-h6htvj2y.js";import"./chunk-2qy62cv4.js";import"./chunk-t2n6fmpy.js";import"./chunk-x1naayst.js";import"./chunk-ng85b73s.js";import"./chunk-351wfvhp.js";import"./chunk-hmm1m733.js";import"./chunk-2bxy8zm1.js";import"./chunk-qq9pvscd.js";import"./chunk-3nc9wy1m.js";import"./chunk-r8ddb02d.js";import"./chunk-dhvwrrqx.js";import"./chunk-56cty7nr.js";import"./chunk-thbjhgw0.js";import"./chunk-p20ft5mj.js";import"./chunk-b5x3zghc.js";import"./chunk-t1f7jeat.js";import"./chunk-tk6gjy9d.js";import"./chunk-pkdk0ppc.js";import"./chunk-hrnx60em.js";import"./chunk-bbznk59q.js";import"./chunk-01gtn79f.js";import"./chunk-meaa7wrs.js";import"./chunk-0ddhkapd.js";import"./chunk-gvj8qg7x.js";import"./chunk-fa03gsff.js";export{c as url,b as openapi,d as listen,e as Server,a as Default};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{Dh as t}from"./chunk-tp7sfreh.js";class k extends Error{cause;constructor(r,e){super(r);this.name="QreditChargeError",this.cause=e}}async function d(r){return t(r)}function x(r){return Number.isInteger(r)?String(r):r.toFixed(2)}function R(r,e){let i={sub:r.sub,name:r.name,email:r.email,expires_at:String(r.expires_at),...e.rotateRefreshToken&&r.refresh_token?{refresh_token:r.refresh_token}:{}};return{type:"api",key:r.access_token,metadata:i}}
2
+ import{Dh as t}from"./chunk-k6eyc1wv.js";class k extends Error{cause;constructor(r,e){super(r);this.name="QreditChargeError",this.cause=e}}async function d(r){return t(r)}function x(r){return Number.isInteger(r)?String(r):r.toFixed(2)}function R(r,e){let i={sub:r.sub,name:r.name,email:r.email,expires_at:String(r.expires_at),...e.rotateRefreshToken&&r.refresh_token?{refresh_token:r.refresh_token}:{}};return{type:"api",key:r.access_token,metadata:i}}
3
3
  export{k as D,d as E,x as F,R as G};
package/bundle/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Gf as eD,Hf as d0}from"./chunk-djcsvcby.js";import{Jf as g0,Kf as l0,Of as y0,Pf as s0}from"./chunk-6tjghyx6.js";import{Sf as Ku}from"./chunk-ntmn6epc.js";import{Cs as k0}from"./chunk-s2g5989e.js";import{Ds as i0}from"./chunk-56cty7nr.js";import"./chunk-thbjhgw0.js";import{Gs as zF,Is as hF,Ms as o0}from"./chunk-v7yvnnmr.js";import{pt as GF}from"./chunk-b5x3zghc.js";import"./chunk-t1f7jeat.js";import"./chunk-tk6gjy9d.js";import"./chunk-pkdk0ppc.js";import"./chunk-hrnx60em.js";import"./chunk-bbznk59q.js";import"./chunk-01gtn79f.js";import"./chunk-meaa7wrs.js";import{lP as b2,mP as w2,pP as p}from"./chunk-fa03gsff.js";var eF=w2((Y3,aF)=>{aF.exports=function(u){if(u===void 0)u=2;if(u>=Error.stackTraceLimit)throw TypeError("getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `"+u+"` and Error.stackTraceLimit was: `"+Error.stackTraceLimit+"`");var F=Error.prepareStackTrace;Error.prepareStackTrace=function(C,f){return f};var E=Error().stack;if(Error.prepareStackTrace=F,E!==null&&typeof E==="object")return E[u]?E[u].getFileName():void 0}});import{notStrictEqual as t2,strictEqual as n2}from"assert";var a0={right:u2,center:F2};class ZF{constructor(D){var u;this.width=D.width,this.wrap=(u=D.wrap)!==null&&u!==void 0?u:!0,this.rows=[]}span(...D){let u=this.div(...D);u.span=!0}resetOutput(){this.rows=[]}div(...D){if(D.length===0)this.div("");if(this.wrap&&this.shouldApplyLayoutDSL(...D)&&typeof D[0]==="string")return this.applyLayoutDSL(D[0]);let u=D.map((F)=>{if(typeof F==="string")return this.colFromString(F);return F});return this.rows.push(u),u}shouldApplyLayoutDSL(...D){return D.length===1&&typeof D[0]==="string"&&/[\t\n]/.test(D[0])}applyLayoutDSL(D){let u=D.split(`
2
+ import{Gf as eD,Hf as d0}from"./chunk-djcsvcby.js";import{Jf as g0,Kf as l0,Of as y0,Pf as s0}from"./chunk-18xhxdsh.js";import{Sf as Ku}from"./chunk-ntmn6epc.js";import{Cs as k0}from"./chunk-n39gqxkz.js";import{Ds as i0}from"./chunk-56cty7nr.js";import"./chunk-thbjhgw0.js";import{Gs as zF,Is as hF,Ms as o0}from"./chunk-p20ft5mj.js";import{pt as GF}from"./chunk-b5x3zghc.js";import"./chunk-t1f7jeat.js";import"./chunk-tk6gjy9d.js";import"./chunk-pkdk0ppc.js";import"./chunk-hrnx60em.js";import"./chunk-bbznk59q.js";import"./chunk-01gtn79f.js";import"./chunk-meaa7wrs.js";import{lP as b2,mP as w2,pP as p}from"./chunk-fa03gsff.js";var eF=w2((Y3,aF)=>{aF.exports=function(u){if(u===void 0)u=2;if(u>=Error.stackTraceLimit)throw TypeError("getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `"+u+"` and Error.stackTraceLimit was: `"+Error.stackTraceLimit+"`");var F=Error.prepareStackTrace;Error.prepareStackTrace=function(C,f){return f};var E=Error().stack;if(Error.prepareStackTrace=F,E!==null&&typeof E==="object")return E[u]?E[u].getFileName():void 0}});import{notStrictEqual as t2,strictEqual as n2}from"assert";var a0={right:u2,center:F2};class ZF{constructor(D){var u;this.width=D.width,this.wrap=(u=D.wrap)!==null&&u!==void 0?u:!0,this.rows=[]}span(...D){let u=this.div(...D);u.span=!0}resetOutput(){this.rows=[]}div(...D){if(D.length===0)this.div("");if(this.wrap&&this.shouldApplyLayoutDSL(...D)&&typeof D[0]==="string")return this.applyLayoutDSL(D[0]);let u=D.map((F)=>{if(typeof F==="string")return this.colFromString(F);return F});return this.rows.push(u),u}shouldApplyLayoutDSL(...D){return D.length===1&&typeof D[0]==="string"&&/[\t\n]/.test(D[0])}applyLayoutDSL(D){let u=D.split(`
3
3
  `).map((E)=>E.split("\t")),F=0;return u.forEach((E)=>{if(E.length>1&&JD.stringWidth(E[0])>F)F=Math.min(Math.floor(this.width*0.5),JD.stringWidth(E[0]))}),u.forEach((E)=>{this.div(...E.map((C,f)=>{return{text:C.trim(),padding:this.measurePadding(C),width:f===0&&E.length>1?F:void 0}}))}),this.rows[this.rows.length-1]}colFromString(D){return{text:D,padding:this.measurePadding(D)}}measurePadding(D){let u=JD.stripAnsi(D);return[0,u.match(/\s*$/)[0].length,0,u.match(/^\s*/)[0].length]}toString(){let D=[];return this.rows.forEach((u)=>{this.rowToString(u,D)}),D.filter((u)=>!u.hidden).map((u)=>u.text).join(`
4
4
  `)}rowToString(D,u){return this.rasterize(D).forEach((F,E)=>{let C="";F.forEach((f,h)=>{let{width:G}=D[h],J=this.negatePadding(D[h]),Y=f;if(J>JD.stringWidth(f))Y+=" ".repeat(J-JD.stringWidth(f));if(D[h].align&&D[h].align!=="left"&&this.wrap){let Q=a0[D[h].align];if(Y=Q(Y,J),JD.stringWidth(Y)<J)Y+=" ".repeat((G||0)-JD.stringWidth(Y)-1)}let U=D[h].padding||[0,0,0,0];if(U[3])C+=" ".repeat(U[3]);if(C+=XF(D[h],Y,"| "),C+=Y,C+=XF(D[h],Y," |"),U[1])C+=" ".repeat(U[1]);if(E===0&&u.length>0)C=this.renderInline(C,u[u.length-1])}),u.push({text:C.replace(/ +$/,""),span:D.span})}),u}renderInline(D,u){let F=D.match(/^ */),E=F?F[0].length:0,C=u.text,f=JD.stringWidth(C.trimRight());if(!u.span)return D;if(!this.wrap)return u.hidden=!0,C+D;if(E<f)return D;return u.hidden=!0,C.trimRight()+" ".repeat(E-f)+D.trimLeft()}rasterize(D){let u=[],F=this.columnWidths(D),E;return D.forEach((C,f)=>{if(C.width=F[f],this.wrap)E=JD.wrap(C.text,this.negatePadding(C),{hard:!0}).split(`
5
5
  `);else E=C.text.split(`
@@ -77,5 +77,5 @@ ${W.join(`
77
77
  `;X.forEach((W)=>{O+=W}),u.fail(O)}};let J={};f.conflicts=function(Q,X){if(q("<string|object> [array|string]",[Q,X],arguments.length),typeof Q==="object")Object.keys(Q).forEach((O)=>{f.conflicts(O,Q[O])});else{if(D.global(Q),!J[Q])J[Q]=[];if(Array.isArray(X))X.forEach((O)=>f.conflicts(Q,O));else J[Q].push(X)}},f.getConflicting=()=>J,f.conflicting=function(Q){if(Object.keys(Q).forEach((X)=>{if(J[X])J[X].forEach((O)=>{if(O&&Q[X]!==void 0&&Q[O]!==void 0)u.fail(E("Arguments %s and %s are mutually exclusive",X,O))})}),D.getInternalMethods().getParserConfiguration()["strip-dashed"])Object.keys(J).forEach((X)=>{J[X].forEach((O)=>{if(O&&Q[F.Parser.camelCase(X)]!==void 0&&Q[F.Parser.camelCase(O)]!==void 0)u.fail(E("Arguments %s and %s are mutually exclusive",X,O))})})},f.recommendCommands=function(Q,X){X=X.sort((A,v)=>v.length-A.length);let W=null,Z=1/0;for(let A=0,v;(v=X[A])!==void 0;A++){let n=O0(Q,v);if(n<=3&&n<Z)Z=n,W=v}if(W)u.fail(E("Did you mean %s?",W))},f.reset=function(Q){return h=xD(h,(X)=>!Q[X]),J=xD(J,(X)=>!Q[X]),f};let Y=[];return f.freeze=function(){Y.push({implied:h,conflicting:J})},f.unfreeze=function(){let Q=Y.pop();XD(Q,void 0,F),{implied:h,conflicting:J}=Q},f}var yu=[],hu;function $u(D,u,F,E){hu=E;let C={};if(Object.prototype.hasOwnProperty.call(D,"extends")){if(typeof D.extends!=="string")return C;let f=/\.json|\..*rc$/.test(D.extends),h=null;if(!f)try{h=import.meta.resolve(D.extends)}catch(G){return D}else h=h8(u,D.extends);f8(h),yu.push(h),C=f?JSON.parse(hu.readFileSync(h,"utf8")):E.require(D.extends),delete D.extends,C=$u(C,hu.path.dirname(h),F,hu)}return yu=[],F?W0(C,D):Object.assign({},C,D)}function f8(D){if(yu.indexOf(D)>-1)throw new DD(`Circular extended configurations: '${D}'.`)}function h8(D,u){return hu.path.resolve(D,u)}function W0(D,u){let F={};function E(C){return C&&typeof C==="object"&&!Array.isArray(C)}Object.assign(F,D);for(let C of Object.keys(u))if(E(u[C])&&E(F[C]))F[C]=W0(D[C],u[C]);else F[C]=u[C];return F}var H=function(D,u,F,E,C){if(E==="m")throw TypeError("Private method is not writable");if(E==="a"&&!C)throw TypeError("Private accessor was defined without a setter");if(typeof u==="function"?D!==u||!C:!u.has(D))throw TypeError("Cannot write private member to an object whose class did not declare it");return E==="a"?C.call(D,F):C?C.value=F:u.set(D,F),F},B=function(D,u,F,E){if(F==="a"&&!E)throw TypeError("Private accessor was defined without a getter");if(typeof u==="function"?D!==u||!E:!u.has(D))throw TypeError("Cannot read private member from an object whose class did not declare it");return F==="m"?E:F==="a"?E.call(D):E?E.value:u.get(D)},uD,vD,zu,ZD,QD,Wu,wD,mD,Uu,WD,Nu,UD,HD,OD,ND,Ru,iD,$D,K,ju,qu,TD,dD,Fu,oD,bD,Hu,P,kD,gD,lD,b,Iu,ID,r;function c0(D){return(u=[],F=D.process.cwd(),E)=>{let C=new p0(u,F,E,D);return Object.defineProperty(C,"argv",{get:()=>{return C.parse()},enumerable:!0}),C.help(),C.version(),C}}var U0=Symbol("copyDoubleDash"),N0=Symbol("copyDoubleDash"),su=Symbol("deleteFromParserHintObject"),R0=Symbol("emitWarning"),j0=Symbol("freeze"),q0=Symbol("getDollarZero"),yD=Symbol("getParserConfiguration"),H0=Symbol("getUsageConfiguration"),ru=Symbol("guessLocale"),I0=Symbol("guessVersion"),V0=Symbol("parsePositionalNumbers"),au=Symbol("pkgUp"),tD=Symbol("populateParserHintArray"),Eu=Symbol("populateParserHintSingleValueDictionary"),eu=Symbol("populateParserHintArrayDictionary"),DF=Symbol("populateParserHintDictionary"),uF=Symbol("sanitizeKey"),FF=Symbol("setKey"),EF=Symbol("unfreeze"),_0=Symbol("validateAsync"),K0=Symbol("getCommandInstance"),L0=Symbol("getContext"),A0=Symbol("getHasOutput"),S0=Symbol("getLoggerInstance"),x0=Symbol("getParseContext"),P0=Symbol("getUsageInstance"),w0=Symbol("getValidationInstance"),Vu=Symbol("hasParseCallback"),b0=Symbol("isGlobalContext"),sD=Symbol("postProcess"),t0=Symbol("rebase"),CF=Symbol("reset"),Gu=Symbol("runYargsParserAndExecuteCommands"),BF=Symbol("runValidation"),n0=Symbol("setHasOutput"),rD=Symbol("kTrackManuallySetKeys"),$8="en_US";class p0{constructor(D=[],u,F,E){this.customScriptName=!1,this.parsed=!1,uD.set(this,void 0),vD.set(this,void 0),zu.set(this,{commands:[],fullCommands:[]}),ZD.set(this,null),QD.set(this,null),Wu.set(this,"show-hidden"),wD.set(this,null),mD.set(this,!0),Uu.set(this,{}),WD.set(this,!0),Nu.set(this,[]),UD.set(this,void 0),HD.set(this,{}),OD.set(this,!1),ND.set(this,null),Ru.set(this,!0),iD.set(this,void 0),$D.set(this,""),K.set(this,void 0),ju.set(this,void 0),qu.set(this,{}),TD.set(this,null),dD.set(this,null),Fu.set(this,{}),oD.set(this,{}),bD.set(this,void 0),Hu.set(this,!1),P.set(this,void 0),kD.set(this,!1),gD.set(this,!1),lD.set(this,!1),b.set(this,void 0),Iu.set(this,{}),ID.set(this,null),r.set(this,void 0),H(this,P,E,"f"),H(this,bD,D,"f"),H(this,vD,u,"f"),H(this,ju,F,"f"),H(this,UD,new gu(this),"f"),this.$0=this[q0](),this[CF](),H(this,uD,B(this,uD,"f"),"f"),H(this,b,B(this,b,"f"),"f"),H(this,r,B(this,r,"f"),"f"),H(this,K,B(this,K,"f"),"f"),B(this,K,"f").showHiddenOpt=B(this,Wu,"f"),H(this,iD,this[N0](),"f"),B(this,P,"f").y18n.setLocale($8)}addHelpOpt(D,u){if(q("[string|boolean] [string]",[D,u],arguments.length),B(this,ND,"f"))this[su](B(this,ND,"f")),H(this,ND,null,"f");if(D===!1&&u===void 0)return this;return H(this,ND,typeof D==="string"?D:"help","f"),this.boolean(B(this,ND,"f")),this.describe(B(this,ND,"f"),u||B(this,b,"f").deferY18nLookup("Show help")),this}help(D,u){return this.addHelpOpt(D,u)}addShowHiddenOpt(D,u){if(q("[string|boolean] [string]",[D,u],arguments.length),D===!1&&u===void 0)return this;let F=typeof D==="string"?D:B(this,Wu,"f");return this.boolean(F),this.describe(F,u||B(this,b,"f").deferY18nLookup("Show hidden options")),B(this,K,"f").showHiddenOpt=F,this}showHidden(D,u){return this.addShowHiddenOpt(D,u)}alias(D,u){return q("<object|string|array> [string|array]",[D,u],arguments.length),this[eu](this.alias.bind(this),"alias",D,u),this}array(D){return q("<array|string>",[D],arguments.length),this[tD]("array",D),this[rD](D),this}boolean(D){return q("<array|string>",[D],arguments.length),this[tD]("boolean",D),this[rD](D),this}check(D,u){return q("<function> [boolean]",[D,u],arguments.length),this.middleware((F,E)=>{return pD(()=>{return D(F,E.getOptions())},(C)=>{if(!C)B(this,b,"f").fail(B(this,P,"f").y18n.__("Argument check failed: %s",D.toString()));else if(typeof C==="string"||C instanceof Error)B(this,b,"f").fail(C.toString(),C);return F},(C)=>{return B(this,b,"f").fail(C.message?C.message:C.toString(),C),F})},!1,u),this}choices(D,u){return q("<object|string|array> [string|array]",[D,u],arguments.length),this[eu](this.choices.bind(this),"choices",D,u),this}coerce(D,u){if(q("<object|string|array> [function]",[D,u],arguments.length),Array.isArray(D)){if(!u)throw new DD("coerce callback must be provided");for(let E of D)this.coerce(E,u);return this}else if(typeof D==="object"){for(let E of Object.keys(D))this.coerce(E,D[E]);return this}if(!u)throw new DD("coerce callback must be provided");let F=D;return B(this,K,"f").key[F]=!0,B(this,UD,"f").addCoerceMiddleware((E,C)=>{var f;let h=(f=C.getAliases()[F])!==null&&f!==void 0?f:[],G=[F,...h].filter((J)=>Object.prototype.hasOwnProperty.call(E,J));if(G.length===0)return E;return pD(()=>{return u(E[G[0]])},(J)=>{return G.forEach((Y)=>{E[Y]=J}),E},(J)=>{throw new DD(J.message)})},F),this}conflicts(D,u){return q("<string|object> [string|array]",[D,u],arguments.length),B(this,r,"f").conflicts(D,u),this}config(D="config",u,F){if(q("[object|string] [string|function] [function]",[D,u,F],arguments.length),typeof D==="object"&&!Array.isArray(D))return D=$u(D,B(this,vD,"f"),this[yD]()["deep-merge-config"]||!1,B(this,P,"f")),B(this,K,"f").configObjects=(B(this,K,"f").configObjects||[]).concat(D),this;if(typeof u==="function")F=u,u=void 0;return this.describe(D,u||B(this,b,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(D)?D:[D]).forEach((E)=>{B(this,K,"f").config[E]=F||!0}),this}completion(D,u,F){if(q("[string] [string|boolean|function] [function]",[D,u,F],arguments.length),typeof u==="function")F=u,u=void 0;if(H(this,QD,D||B(this,QD,"f")||"completion","f"),!u&&u!==!1)u="generate completion script";if(this.command(B(this,QD,"f"),u),F)B(this,ZD,"f").registerFunction(F);return this}command(D,u,F,E,C,f){return q("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[D,u,F,E,C,f],arguments.length),B(this,uD,"f").addHandler(D,u,F,E,C,f),this}commands(D,u,F,E,C,f){return this.command(D,u,F,E,C,f)}commandDir(D,u){q("<string> [object]",[D,u],arguments.length);let F=B(this,ju,"f")||B(this,P,"f").require;return B(this,uD,"f").addDirectory(D,F,B(this,P,"f").getCallerFile(),u),this}count(D){return q("<array|string>",[D],arguments.length),this[tD]("count",D),this[rD](D),this}default(D,u,F){if(q("<object|string|array> [*] [string]",[D,u,F],arguments.length),F)ku(D,B(this,P,"f")),B(this,K,"f").defaultDescription[D]=F;if(typeof u==="function"){if(ku(D,B(this,P,"f")),!B(this,K,"f").defaultDescription[D])B(this,K,"f").defaultDescription[D]=B(this,b,"f").functionDescription(u);u=u.call()}return this[Eu](this.default.bind(this),"default",D,u),this}defaults(D,u,F){return this.default(D,u,F)}demandCommand(D=1,u,F,E){if(q("[number] [number|string] [string|null|undefined] [string|null|undefined]",[D,u,F,E],arguments.length),typeof u!=="number")F=u,u=1/0;return this.global("_",!1),B(this,K,"f").demandedCommands._={min:D,max:u,minMsg:F,maxMsg:E},this}demand(D,u,F){if(Array.isArray(u))u.forEach((E)=>{XD(F,!0,B(this,P,"f")),this.demandOption(E,F)}),u=1/0;else if(typeof u!=="number")F=u,u=1/0;if(typeof D==="number")XD(F,!0,B(this,P,"f")),this.demandCommand(D,u,F,F);else if(Array.isArray(D))D.forEach((E)=>{XD(F,!0,B(this,P,"f")),this.demandOption(E,F)});else if(typeof F==="string")this.demandOption(D,F);else if(F===!0||typeof F>"u")this.demandOption(D);return this}demandOption(D,u){return q("<object|string|array> [string]",[D,u],arguments.length),this[Eu](this.demandOption.bind(this),"demandedOptions",D,u),this}deprecateOption(D,u){return q("<string> [string|boolean]",[D,u],arguments.length),B(this,K,"f").deprecatedOptions[D]=u,this}describe(D,u){return q("<object|string|array> [string]",[D,u],arguments.length),this[FF](D,!0),B(this,b,"f").describe(D,u),this}detectLocale(D){return q("<boolean>",[D],arguments.length),H(this,mD,D,"f"),this}env(D){if(q("[string|boolean]",[D],arguments.length),D===!1)delete B(this,K,"f").envPrefix;else B(this,K,"f").envPrefix=D||"";return this}epilogue(D){return q("<string>",[D],arguments.length),B(this,b,"f").epilog(D),this}epilog(D){return this.epilogue(D)}example(D,u){if(q("<string|array> [string]",[D,u],arguments.length),Array.isArray(D))D.forEach((F)=>this.example(...F));else B(this,b,"f").example(D,u);return this}exit(D,u){if(H(this,OD,!0,"f"),H(this,wD,u,"f"),B(this,WD,"f"))B(this,P,"f").process.exit(D)}exitProcess(D=!0){return q("[boolean]",[D],arguments.length),H(this,WD,D,"f"),this}fail(D){if(q("<function|boolean>",[D],arguments.length),typeof D==="boolean"&&D!==!1)throw new DD("Invalid first argument. Expected function or boolean 'false'");return B(this,b,"f").failFn(D),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(D,u){if(q("<array> [function]",[D,u],arguments.length),!u)return new Promise((F,E)=>{B(this,ZD,"f").getCompletion(D,(C,f)=>{if(C)E(C);else F(f)})});else return B(this,ZD,"f").getCompletion(D,u)}getDemandedOptions(){return q([],0),B(this,K,"f").demandedOptions}getDemandedCommands(){return q([],0),B(this,K,"f").demandedCommands}getDeprecatedOptions(){return q([],0),B(this,K,"f").deprecatedOptions}getDetectLocale(){return B(this,mD,"f")}getExitProcess(){return B(this,WD,"f")}getGroups(){return Object.assign({},B(this,HD,"f"),B(this,oD,"f"))}getHelp(){if(H(this,OD,!0,"f"),!B(this,b,"f").hasCachedHelpMessage()){if(!this.parsed){let u=this[Gu](B(this,bD,"f"),void 0,void 0,0,!0);if(l(u))return u.then(()=>{return B(this,b,"f").help()})}let D=B(this,uD,"f").runDefaultBuilderOn(this);if(l(D))return D.then(()=>{return B(this,b,"f").help()})}return Promise.resolve(B(this,b,"f").help())}getOptions(){return B(this,K,"f")}getStrict(){return B(this,kD,"f")}getStrictCommands(){return B(this,gD,"f")}getStrictOptions(){return B(this,lD,"f")}global(D,u){if(q("<string|array> [boolean]",[D,u],arguments.length),D=[].concat(D),u!==!1)B(this,K,"f").local=B(this,K,"f").local.filter((F)=>D.indexOf(F)===-1);else D.forEach((F)=>{if(!B(this,K,"f").local.includes(F))B(this,K,"f").local.push(F)});return this}group(D,u){q("<string|array> <string>",[D,u],arguments.length);let F=B(this,oD,"f")[u]||B(this,HD,"f")[u];if(B(this,oD,"f")[u])delete B(this,oD,"f")[u];let E={};return B(this,HD,"f")[u]=(F||[]).concat(D).filter((C)=>{if(E[C])return!1;return E[C]=!0}),this}hide(D){return q("<string>",[D],arguments.length),B(this,K,"f").hiddenOptions.push(D),this}implies(D,u){return q("<string|object> [number|string|array]",[D,u],arguments.length),B(this,r,"f").implies(D,u),this}locale(D){if(q("[string]",[D],arguments.length),D===void 0)return this[ru](),B(this,P,"f").y18n.getLocale();return H(this,mD,!1,"f"),B(this,P,"f").y18n.setLocale(D),this}middleware(D,u,F){return B(this,UD,"f").addMiddleware(D,!!u,F)}nargs(D,u){return q("<string|object|array> [number]",[D,u],arguments.length),this[Eu](this.nargs.bind(this),"narg",D,u),this}normalize(D){return q("<array|string>",[D],arguments.length),this[tD]("normalize",D),this}number(D){return q("<array|string>",[D],arguments.length),this[tD]("number",D),this[rD](D),this}option(D,u){if(q("<string|object> [object]",[D,u],arguments.length),typeof D==="object")Object.keys(D).forEach((F)=>{this.options(F,D[F])});else{if(typeof u!=="object")u={};if(this[rD](D),B(this,ID,"f")&&(D==="version"||(u===null||u===void 0?void 0:u.alias)==="version"))this[R0](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(`
78
78
  `),void 0,"versionWarning");if(B(this,K,"f").key[D]=!0,u.alias)this.alias(D,u.alias);let F=u.deprecate||u.deprecated;if(F)this.deprecateOption(D,F);let E=u.demand||u.required||u.require;if(E)this.demand(D,E);if(u.demandOption)this.demandOption(D,typeof u.demandOption==="string"?u.demandOption:void 0);if(u.conflicts)this.conflicts(D,u.conflicts);if("default"in u)this.default(D,u.default);if(u.implies!==void 0)this.implies(D,u.implies);if(u.nargs!==void 0)this.nargs(D,u.nargs);if(u.config)this.config(D,u.configParser);if(u.normalize)this.normalize(D);if(u.choices)this.choices(D,u.choices);if(u.coerce)this.coerce(D,u.coerce);if(u.group)this.group(D,u.group);if(u.boolean||u.type==="boolean"){if(this.boolean(D),u.alias)this.boolean(u.alias)}if(u.array||u.type==="array"){if(this.array(D),u.alias)this.array(u.alias)}if(u.number||u.type==="number"){if(this.number(D),u.alias)this.number(u.alias)}if(u.string||u.type==="string"){if(this.string(D),u.alias)this.string(u.alias)}if(u.count||u.type==="count")this.count(D);if(typeof u.global==="boolean")this.global(D,u.global);if(u.defaultDescription)B(this,K,"f").defaultDescription[D]=u.defaultDescription;if(u.skipValidation)this.skipValidation(D);let C=u.describe||u.description||u.desc,f=B(this,b,"f").getDescriptions();if(!Object.prototype.hasOwnProperty.call(f,D)||typeof C==="string")this.describe(D,C);if(u.hidden)this.hide(D);if(u.requiresArg)this.requiresArg(D)}return this}options(D,u){return this.option(D,u)}parse(D,u,F){if(q("[string|array] [function|boolean|object] [function]",[D,u,F],arguments.length),this[j0](),typeof D>"u")D=B(this,bD,"f");if(typeof u==="object")H(this,dD,u,"f"),u=F;if(typeof u==="function")H(this,TD,u,"f"),u=!1;if(!u)H(this,bD,D,"f");if(B(this,TD,"f"))H(this,WD,!1,"f");let E=this[Gu](D,!!u),C=this.parsed;if(B(this,ZD,"f").setParsed(this.parsed),l(E))return E.then((f)=>{if(B(this,TD,"f"))B(this,TD,"f").call(this,B(this,wD,"f"),f,B(this,$D,"f"));return f}).catch((f)=>{if(B(this,TD,"f"))B(this,TD,"f")(f,this.parsed.argv,B(this,$D,"f"));throw f}).finally(()=>{this[EF](),this.parsed=C});else{if(B(this,TD,"f"))B(this,TD,"f").call(this,B(this,wD,"f"),E,B(this,$D,"f"));this[EF](),this.parsed=C}return E}parseAsync(D,u,F){let E=this.parse(D,u,F);return!l(E)?Promise.resolve(E):E}parseSync(D,u,F){let E=this.parse(D,u,F);if(l(E))throw new DD(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return E}parserConfiguration(D){return q("<object>",[D],arguments.length),H(this,qu,D,"f"),this}pkgConf(D,u){q("<string> [string]",[D,u],arguments.length);let F=null,E=this[au](u||B(this,vD,"f"));if(E[D]&&typeof E[D]==="object")F=$u(E[D],u||B(this,vD,"f"),this[yD]()["deep-merge-config"]||!1,B(this,P,"f")),B(this,K,"f").configObjects=(B(this,K,"f").configObjects||[]).concat(F);return this}positional(D,u){q("<string> <object>",[D,u],arguments.length);let F=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];u=xD(u,(f,h)=>{if(f==="type"&&!["string","number","boolean"].includes(h))return!1;return F.includes(f)});let E=B(this,zu,"f").fullCommands[B(this,zu,"f").fullCommands.length-1],C=E?B(this,uD,"f").cmdToParseOptions(E):{array:[],alias:{},default:{},demand:{}};return Du(C).forEach((f)=>{let h=C[f];if(Array.isArray(h)){if(h.indexOf(D)!==-1)u[f]=!0}else if(h[D]&&!(f in u))u[f]=h[D]}),this.group(D,B(this,b,"f").getPositionalGroupName()),this.option(D,u)}recommendCommands(D=!0){return q("[boolean]",[D],arguments.length),H(this,Hu,D,"f"),this}required(D,u,F){return this.demand(D,u,F)}require(D,u,F){return this.demand(D,u,F)}requiresArg(D){if(q("<array|string|object> [number]",[D],arguments.length),typeof D==="string"&&B(this,K,"f").narg[D])return this;else this[Eu](this.requiresArg.bind(this),"narg",D,NaN);return this}showCompletionScript(D,u){return q("[string] [string]",[D,u],arguments.length),D=D||this.$0,B(this,iD,"f").log(B(this,ZD,"f").generateCompletionScript(D,u||B(this,QD,"f")||"completion")),this}showHelp(D){if(q("[string|function]",[D],arguments.length),H(this,OD,!0,"f"),!B(this,b,"f").hasCachedHelpMessage()){if(!this.parsed){let F=this[Gu](B(this,bD,"f"),void 0,void 0,0,!0);if(l(F))return F.then(()=>{B(this,b,"f").showHelp(D)}),this}let u=B(this,uD,"f").runDefaultBuilderOn(this);if(l(u))return u.then(()=>{B(this,b,"f").showHelp(D)}),this}return B(this,b,"f").showHelp(D),this}scriptName(D){return this.customScriptName=!0,this.$0=D,this}showHelpOnFail(D,u){return q("[boolean|string] [string]",[D,u],arguments.length),B(this,b,"f").showHelpOnFail(D,u),this}showVersion(D){return q("[string|function]",[D],arguments.length),B(this,b,"f").showVersion(D),this}skipValidation(D){return q("<array|string>",[D],arguments.length),this[tD]("skipValidation",D),this}strict(D){return q("[boolean]",[D],arguments.length),H(this,kD,D!==!1,"f"),this}strictCommands(D){return q("[boolean]",[D],arguments.length),H(this,gD,D!==!1,"f"),this}strictOptions(D){return q("[boolean]",[D],arguments.length),H(this,lD,D!==!1,"f"),this}string(D){return q("<array|string>",[D],arguments.length),this[tD]("string",D),this[rD](D),this}terminalWidth(){return q([],0),B(this,P,"f").process.stdColumns}updateLocale(D){return this.updateStrings(D)}updateStrings(D){return q("<object>",[D],arguments.length),H(this,mD,!1,"f"),B(this,P,"f").y18n.updateLocale(D),this}usage(D,u,F,E){if(q("<string|null|undefined> [string|boolean] [function|object] [function]",[D,u,F,E],arguments.length),u!==void 0)if(XD(D,null,B(this,P,"f")),(D||"").match(/^\$0( |$)/))return this.command(D,u,F,E);else throw new DD(".usage() description must start with $0 if being used as alias for .command()");else return B(this,b,"f").usage(D),this}usageConfiguration(D){return q("<object>",[D],arguments.length),H(this,Iu,D,"f"),this}version(D,u,F){if(q("[boolean|string] [string] [string]",[D,u,F],arguments.length),B(this,ID,"f"))this[su](B(this,ID,"f")),B(this,b,"f").version(void 0),H(this,ID,null,"f");if(arguments.length===0)F=this[I0](),D="version";else if(arguments.length===1){if(D===!1)return this;F=D,D="version"}else if(arguments.length===2)F=u,u=void 0;return H(this,ID,typeof D==="string"?D:"version","f"),u=u||B(this,b,"f").deferY18nLookup("Show version number"),B(this,b,"f").version(F||void 0),this.boolean(B(this,ID,"f")),this.describe(B(this,ID,"f"),u),this}wrap(D){return q("<number|null|undefined>",[D],arguments.length),B(this,b,"f").wrap(D),this}[(uD=new WeakMap,vD=new WeakMap,zu=new WeakMap,ZD=new WeakMap,QD=new WeakMap,Wu=new WeakMap,wD=new WeakMap,mD=new WeakMap,Uu=new WeakMap,WD=new WeakMap,Nu=new WeakMap,UD=new WeakMap,HD=new WeakMap,OD=new WeakMap,ND=new WeakMap,Ru=new WeakMap,iD=new WeakMap,$D=new WeakMap,K=new WeakMap,ju=new WeakMap,qu=new WeakMap,TD=new WeakMap,dD=new WeakMap,Fu=new WeakMap,oD=new WeakMap,bD=new WeakMap,Hu=new WeakMap,P=new WeakMap,kD=new WeakMap,gD=new WeakMap,lD=new WeakMap,b=new WeakMap,Iu=new WeakMap,ID=new WeakMap,r=new WeakMap,U0)](D){if(!D._||!D["--"])return D;D._.push.apply(D._,D["--"]);try{delete D["--"]}catch(u){}return D}[N0](){return{log:(...D)=>{if(!this[Vu]())console.log(...D);if(H(this,OD,!0,"f"),B(this,$D,"f").length)H(this,$D,B(this,$D,"f")+`
79
79
  `,"f");H(this,$D,B(this,$D,"f")+D.join(" "),"f")},error:(...D)=>{if(!this[Vu]())console.error(...D);if(H(this,OD,!0,"f"),B(this,$D,"f").length)H(this,$D,B(this,$D,"f")+`
80
- `,"f");H(this,$D,B(this,$D,"f")+D.join(" "),"f")}}}[su](D){Du(B(this,K,"f")).forEach((u)=>{if(((E)=>E==="configObjects")(u))return;let F=B(this,K,"f")[u];if(Array.isArray(F)){if(F.includes(D))F.splice(F.indexOf(D),1)}else if(typeof F==="object")delete F[D]}),delete B(this,b,"f").getDescriptions()[D]}[R0](D,u,F){if(!B(this,Uu,"f")[F])B(this,P,"f").process.emitWarning(D,u),B(this,Uu,"f")[F]=!0}[j0](){B(this,Nu,"f").push({options:B(this,K,"f"),configObjects:B(this,K,"f").configObjects.slice(0),exitProcess:B(this,WD,"f"),groups:B(this,HD,"f"),strict:B(this,kD,"f"),strictCommands:B(this,gD,"f"),strictOptions:B(this,lD,"f"),completionCommand:B(this,QD,"f"),output:B(this,$D,"f"),exitError:B(this,wD,"f"),hasOutput:B(this,OD,"f"),parsed:this.parsed,parseFn:B(this,TD,"f"),parseContext:B(this,dD,"f")}),B(this,b,"f").freeze(),B(this,r,"f").freeze(),B(this,uD,"f").freeze(),B(this,UD,"f").freeze()}[q0](){let D="",u;if(/\b(node|iojs|electron)(\.exe)?$/.test(B(this,P,"f").process.argv()[0]))u=B(this,P,"f").process.argv().slice(1,2);else u=B(this,P,"f").process.argv().slice(0,1);if(D=u.map((F)=>{let E=this[t0](B(this,vD,"f"),F);return F.match(/^(\/|([a-zA-Z]:)?\\)/)&&E.length<F.length?E:F}).join(" ").trim(),B(this,P,"f").getEnv("_")&&B(this,P,"f").getProcessArgvBin()===B(this,P,"f").getEnv("_"))D=B(this,P,"f").getEnv("_").replace(`${B(this,P,"f").path.dirname(B(this,P,"f").process.execPath())}/`,"");return D}[yD](){return B(this,qu,"f")}[H0](){return B(this,Iu,"f")}[ru](){if(!B(this,mD,"f"))return;let D=B(this,P,"f").getEnv("LC_ALL")||B(this,P,"f").getEnv("LC_MESSAGES")||B(this,P,"f").getEnv("LANG")||B(this,P,"f").getEnv("LANGUAGE")||"en_US";this.locale(D.replace(/[.:].*/,""))}[I0](){return this[au]().version||"unknown"}[V0](D){let u=D["--"]?D["--"]:D._;for(let F=0,E;(E=u[F])!==void 0;F++)if(B(this,P,"f").Parser.looksLikeNumber(E)&&Number.isSafeInteger(Math.floor(parseFloat(`${E}`))))u[F]=Number(E);return D}[au](D){let u=D||"*";if(B(this,Fu,"f")[u])return B(this,Fu,"f")[u];let F={};try{let E=D||B(this,P,"f").mainFilename;if(B(this,P,"f").path.extname(E))E=B(this,P,"f").path.dirname(E);let C=B(this,P,"f").findUp(E,(f,h)=>{if(h.includes("package.json"))return"package.json";else return});XD(C,void 0,B(this,P,"f")),F=JSON.parse(B(this,P,"f").readFileSync(C,"utf8"))}catch(E){}return B(this,Fu,"f")[u]=F||{},B(this,Fu,"f")[u]}[tD](D,u){u=[].concat(u),u.forEach((F)=>{F=this[uF](F),B(this,K,"f")[D].push(F)})}[Eu](D,u,F,E){this[DF](D,u,F,E,(C,f,h)=>{B(this,K,"f")[C][f]=h})}[eu](D,u,F,E){this[DF](D,u,F,E,(C,f,h)=>{B(this,K,"f")[C][f]=(B(this,K,"f")[C][f]||[]).concat(h)})}[DF](D,u,F,E,C){if(Array.isArray(F))F.forEach((f)=>{D(f,E)});else if(((f)=>typeof f==="object")(F))for(let f of Du(F))D(f,F[f]);else C(u,this[uF](F),E)}[uF](D){if(D==="__proto__")return"___proto___";return D}[FF](D,u){return this[Eu](this[FF].bind(this),"key",D,u),this}[EF](){var D,u,F,E,C,f,h,G,J,Y,U,Q;let X=B(this,Nu,"f").pop();XD(X,void 0,B(this,P,"f"));let O;D=this,u=this,F=this,E=this,C=this,f=this,h=this,G=this,J=this,Y=this,U=this,Q=this,{options:{set value(W){H(D,K,W,"f")}}.value,configObjects:O,exitProcess:{set value(W){H(u,WD,W,"f")}}.value,groups:{set value(W){H(F,HD,W,"f")}}.value,output:{set value(W){H(E,$D,W,"f")}}.value,exitError:{set value(W){H(C,wD,W,"f")}}.value,hasOutput:{set value(W){H(f,OD,W,"f")}}.value,parsed:this.parsed,strict:{set value(W){H(h,kD,W,"f")}}.value,strictCommands:{set value(W){H(G,gD,W,"f")}}.value,strictOptions:{set value(W){H(J,lD,W,"f")}}.value,completionCommand:{set value(W){H(Y,QD,W,"f")}}.value,parseFn:{set value(W){H(U,TD,W,"f")}}.value,parseContext:{set value(W){H(Q,dD,W,"f")}}.value}=X,B(this,K,"f").configObjects=O,B(this,b,"f").unfreeze(),B(this,r,"f").unfreeze(),B(this,uD,"f").unfreeze(),B(this,UD,"f").unfreeze()}[_0](D,u){return pD(u,(F)=>{return D(F),F})}getInternalMethods(){return{getCommandInstance:this[K0].bind(this),getContext:this[L0].bind(this),getHasOutput:this[A0].bind(this),getLoggerInstance:this[S0].bind(this),getParseContext:this[x0].bind(this),getParserConfiguration:this[yD].bind(this),getUsageConfiguration:this[H0].bind(this),getUsageInstance:this[P0].bind(this),getValidationInstance:this[w0].bind(this),hasParseCallback:this[Vu].bind(this),isGlobalContext:this[b0].bind(this),postProcess:this[sD].bind(this),reset:this[CF].bind(this),runValidation:this[BF].bind(this),runYargsParserAndExecuteCommands:this[Gu].bind(this),setHasOutput:this[n0].bind(this)}}[K0](){return B(this,uD,"f")}[L0](){return B(this,zu,"f")}[A0](){return B(this,OD,"f")}[S0](){return B(this,iD,"f")}[x0](){return B(this,dD,"f")||{}}[P0](){return B(this,b,"f")}[w0](){return B(this,r,"f")}[Vu](){return!!B(this,TD,"f")}[b0](){return B(this,Ru,"f")}[sD](D,u,F,E){if(F)return D;if(l(D))return D;if(!u)D=this[U0](D);if(this[yD]()["parse-positional-numbers"]||this[yD]()["parse-positional-numbers"]===void 0)D=this[V0](D);if(E)D=cD(D,this,B(this,UD,"f").getMiddleware(),!1);return D}[CF](D={}){H(this,K,B(this,K,"f")||{},"f");let u={};u.local=B(this,K,"f").local||[],u.configObjects=B(this,K,"f").configObjects||[];let F={};u.local.forEach((f)=>{F[f]=!0,(D[f]||[]).forEach((h)=>{F[h]=!0})}),Object.assign(B(this,oD,"f"),Object.keys(B(this,HD,"f")).reduce((f,h)=>{let G=B(this,HD,"f")[h].filter((J)=>!(J in F));if(G.length>0)f[h]=G;return f},{})),H(this,HD,{},"f");let E=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],C=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];if(E.forEach((f)=>{u[f]=(B(this,K,"f")[f]||[]).filter((h)=>!F[h])}),C.forEach((f)=>{u[f]=xD(B(this,K,"f")[f],(h)=>!F[h])}),u.envPrefix=B(this,K,"f").envPrefix,H(this,K,u,"f"),H(this,b,B(this,b,"f")?B(this,b,"f").reset(F):M0(this,B(this,P,"f")),"f"),H(this,r,B(this,r,"f")?B(this,r,"f").reset(F):Y0(this,B(this,b,"f"),B(this,P,"f")),"f"),H(this,uD,B(this,uD,"f")?B(this,uD,"f").reset():$0(B(this,b,"f"),B(this,r,"f"),B(this,UD,"f"),B(this,P,"f")),"f"),!B(this,ZD,"f"))H(this,ZD,Q0(this,B(this,b,"f"),B(this,uD,"f"),B(this,P,"f")),"f");return B(this,UD,"f").reset(),H(this,QD,null,"f"),H(this,$D,"","f"),H(this,wD,null,"f"),H(this,OD,!1,"f"),this.parsed=!1,this}[t0](D,u){return B(this,P,"f").path.relative(D,u)}[Gu](D,u,F,E=0,C=!1){var f,h,G,J;let Y=!!F||C;D=D||B(this,bD,"f"),B(this,K,"f").__=B(this,P,"f").y18n.__,B(this,K,"f").configuration=this[yD]();let U=!!B(this,K,"f").configuration["populate--"],Q=Object.assign({},B(this,K,"f").configuration,{"populate--":!0}),X=B(this,P,"f").Parser.detailed(D,Object.assign({},B(this,K,"f"),{configuration:{"parse-positional-numbers":!1,...Q}})),O=Object.assign(X.argv,B(this,dD,"f")),W=void 0,Z=X.aliases,A=!1,v=!1;if(Object.keys(O).forEach((n)=>{if(n===B(this,ND,"f")&&O[n])A=!0;else if(n===B(this,ID,"f")&&O[n])v=!0}),O.$0=this.$0,this.parsed=X,E===0)B(this,b,"f").clearCachedHelpMessage();try{if(this[ru](),u)return this[sD](O,U,!!F,!1);if(B(this,ND,"f")){if([B(this,ND,"f")].concat(Z[B(this,ND,"f")]||[]).filter((ED)=>ED.length>1).includes(""+O._[O._.length-1]))O._.pop(),A=!0}H(this,Ru,!1,"f");let n=B(this,uD,"f").getCommands(),GD=((f=B(this,ZD,"f"))===null||f===void 0?void 0:f.completionKey)?[(h=B(this,ZD,"f"))===null||h===void 0?void 0:h.completionKey,...(J=this.getAliases()[(G=B(this,ZD,"f"))===null||G===void 0?void 0:G.completionKey])!==null&&J!==void 0?J:[]].some((g)=>Object.prototype.hasOwnProperty.call(O,g)):!1,t=A||GD||C;if(O._.length){if(n.length){let g;for(let ED=E||0,a;O._[ED]!==void 0;ED++)if(a=String(O._[ED]),n.includes(a)&&a!==B(this,QD,"f")){let qD=B(this,uD,"f").runCommand(a,this,X,ED+1,C,A||v||C);return this[sD](qD,U,!!F,!1)}else if(!g&&a!==B(this,QD,"f")){g=a;break}if(!B(this,uD,"f").hasDefaultCommand()&&B(this,Hu,"f")&&g&&!t)B(this,r,"f").recommendCommands(g,n)}if(B(this,QD,"f")&&O._.includes(B(this,QD,"f"))&&!GD){if(B(this,WD,"f"))PD(!0);this.showCompletionScript(),this.exit(0)}}if(B(this,uD,"f").hasDefaultCommand()&&!t){let g=B(this,uD,"f").runCommand(null,this,X,0,C,A||v||C);return this[sD](g,U,!!F,!1)}if(GD){if(B(this,WD,"f"))PD(!0);D=[].concat(D);let g=D.slice(D.indexOf(`--${B(this,ZD,"f").completionKey}`)+1);return B(this,ZD,"f").getCompletion(g,(ED,a)=>{if(ED)throw new DD(ED.message);(a||[]).forEach((qD)=>{B(this,iD,"f").log(qD)}),this.exit(0)}),this[sD](O,!U,!!F,!1)}if(!B(this,OD,"f")){if(A){if(B(this,WD,"f"))PD(!0);Y=!0,this.showHelp((g)=>{B(this,iD,"f").log(g),this.exit(0)})}else if(v){if(B(this,WD,"f"))PD(!0);Y=!0,B(this,b,"f").showVersion("log"),this.exit(0)}}if(!Y&&B(this,K,"f").skipValidation.length>0)Y=Object.keys(O).some((g)=>B(this,K,"f").skipValidation.indexOf(g)>=0&&O[g]===!0);if(!Y){if(X.error)throw new DD(X.error.message);if(!GD){let g=this[BF](Z,{},X.error);if(!F)W=cD(O,this,B(this,UD,"f").getMiddleware(),!0);if(W=this[_0](g,W!==null&&W!==void 0?W:O),l(W)&&!F)W=W.then(()=>{return cD(O,this,B(this,UD,"f").getMiddleware(),!1)})}}}catch(n){if(n instanceof DD)B(this,b,"f").fail(n.message,n);else throw n}return this[sD](W!==null&&W!==void 0?W:O,U,!!F,!0)}[BF](D,u,F,E){let C={...this.getDemandedOptions()};return(f)=>{if(F)throw new DD(F.message);B(this,r,"f").nonOptionCount(f),B(this,r,"f").requiredArguments(f,C);let h=!1;if(B(this,gD,"f"))h=B(this,r,"f").unknownCommands(f);if(B(this,kD,"f")&&!h)B(this,r,"f").unknownArguments(f,D,u,!!E);else if(B(this,lD,"f"))B(this,r,"f").unknownArguments(f,D,{},!1,!1);B(this,r,"f").limitedChoices(f),B(this,r,"f").implications(f),B(this,r,"f").conflicting(f)}}[n0](){H(this,OD,!0,"f")}[rD](D){if(typeof D==="string")B(this,K,"f").key[D]=!0;else for(let u of D)B(this,K,"f").key[u]=!0}}function z0(D){return!!D&&typeof D.getInternalMethods==="function"}var z8=c0(ou),v0=z8;import{EOL as LD}from"os";import G8 from"path";var m0=o0("main");k0("main");var VD=iu(process.argv);if(VD.length===1&&(VD[0]==="--version"||VD[0]==="-v"))process.stdout.write(zF+LD),process.exit();var _u={acp:()=>import("./chunk-dgbvsnqb.js").then((D)=>D.AcpCommand),mcp:()=>import("./chunk-c422awkv.js").then((D)=>D.McpCommand),attach:()=>import("./chunk-p77m937s.js").then((D)=>D.AttachCommand),run:()=>import("./chunk-2w154wad.js").then((D)=>D.RunCommand),generate:()=>import("./chunk-4pedvzse.js").then((D)=>D.GenerateCommand),debug:()=>import("./chunk-dvn528qs.js").then((D)=>D.DebugCommand),console:()=>import("./chunk-anse7bd0.js").then((D)=>D.ConsoleCommand),providers:()=>import("./chunk-1q2vhe78.js").then((D)=>D.ProvidersCommand),agent:()=>import("./chunk-ysxmk1z1.js").then((D)=>D.AgentCommand),upgrade:()=>import("./chunk-p41h8naw.js").then((D)=>D.UpgradeCommand),uninstall:()=>import("./chunk-nt07vncv.js").then((D)=>D.UninstallCommand),serve:()=>import("./chunk-28knamc9.js").then((D)=>D.ServeCommand),models:()=>import("./chunk-1brsnwhv.js").then((D)=>D.ModelsCommand),stats:()=>import("./chunk-n0y1ea17.js").then((D)=>D.StatsCommand),usage:()=>import("./chunk-skjge2wh.js").then((D)=>D.UsageCommand),export:()=>import("./chunk-k6z419yx.js").then((D)=>D.ExportCommand),import:()=>import("./chunk-mpn5qm9j.js").then((D)=>D.ImportCommand),github:()=>import("./chunk-dp3hqm2m.js").then((D)=>D.GithubCommand),pr:()=>import("./chunk-y36ggefa.js").then((D)=>D.PrCommand),session:()=>import("./chunk-k728fzrr.js").then((D)=>D.SessionCommand),plugin:()=>import("./chunk-1gj0m10e.js").then((D)=>D.PluginCommand),plug:()=>import("./chunk-1gj0m10e.js").then((D)=>D.PluginCommand),auth:()=>import("./chunk-hjvje9xj.js").then((D)=>D.AuthCommand),qredits:()=>import("./chunk-gspdrdyq.js").then((D)=>D.QreditsCommand),db:()=>import("./chunk-r2waj5n2.js").then((D)=>D.DbCommand),default:()=>import("./chunk-3gdqmave.js").then((D)=>D.TuiThreadCommand)};function s(D,u,F){return{command:D,describe:u,aliases:F,handler:async()=>{}}}function fF(){return[s("acp","start ACP (Agent Client Protocol) server"),s("mcp","manage MCP (Model Context Protocol) servers"),{command:"$0 [project]",describe:"start qitqode tui",builder:(D)=>D.positional("project",{type:"string",describe:"path to start qitqode in"}).options(l0).options(y0).option("never-ask",{type:"boolean",describe:"start in never-ask mode, auto-decide without asking (permissions excluded)",default:!1}).option("trust",{type:"boolean",describe:"skip workspace trust prompt and trust the directory",default:!1}),handler:async()=>{}},s("attach <url>","attach to a running qitqode server"),s("run [message..]","run qitqode with a message"),s("generate","generate files"),s("debug","debugging and troubleshooting tools"),s("console","manage qitqode accounts"),s("providers","manage AI providers and credentials",["auth"]),s("agent","manage agents"),s("upgrade [target]","upgrade qitqode to the latest or a specific version"),s("uninstall","uninstall qitqode and remove all related files"),s("serve","starts a headless qitqode server"),s("models [provider]","list all available models"),s("stats","show token usage and cost statistics"),s("usage [sessionID]","show per-turn token usage and cost"),s("export [sessionID]","export session data as JSON"),s("import <file>","import session data from JSON file or URL"),s("github","manage GitHub agent"),s("pr <number>","fetch and checkout a GitHub PR branch, then run qitqode"),s("session","manage sessions"),s("plugin <module>","install plugin and update config",["plug"]),s("auth <command>","Sign in or out of Forgewise"),s("qredits <command>","Check Qredits balance and spend history"),s("db","database tools")]}function $F(D){let u=new Set(["--log-level","--model","-m","--session","-s","--prompt","--agent","--port","--hostname","--mdns-domain","--cors"]);for(let F=0;F<D.length;F++){let E=D[F];if(E==="--")return;if(E.startsWith("-")){if(u.has(E))F++;continue}return E}}function M8(D){return D.length>0&&D.every((u)=>u==="--help"||u==="-h")}function X8(D){return D.includes("--help")||D.includes("-h")}async function Z8(D){let u=$F(D);if(D.includes("--get-yargs-completions")||u==="completion")return fF();if(M8(D))return fF();else if(u&&u in _u)return[await _u[u]()];else if(X8(D))return fF();else return[await _u.default()]}function r0(D){let u=D.trimStart();if(!u.startsWith("qitqode ")){process.stderr.write(Ku.logo()+LD+LD),process.stderr.write(u);return}process.stderr.write(D)}var Mu=g0(v0(VD)).middleware(async(D)=>{if(D.pure)process.env.QITQODE_PURE="1";let u=await import("./chunk-w8rvjbgr.js"),{Filesystem:F}=await import("./chunk-7nas10jx.js"),{Heap:E}=await import("./chunk-rdsae6k4.js"),{Global:C}=await import("./chunk-b49rxw15.js");await u.init({print:process.argv.includes("--print-logs"),dev:hF,level:(()=>{if(D.logLevel)return D.logLevel;if(hF)return"DEBUG";return"INFO"})()}),E.start(),(await import("./chunk-0fwz5r1k.js")).startRefresh(),process.env.AGENT="1",process.env.QITQODE="1",process.env.QITQODE_PID=String(process.pid),u.Default.info("qitqode",{version:zF,command:$F(VD)??"tui",process_role:m0.processRole,run_id:m0.runID});let h=G8.join(C.Path.data,"qitqode.db");if(!await F.exists(h)){let{JsonMigration:G,Database:J}=await import("./chunk-6bq7rx7m.js"),{drizzle:Y}=await import("./chunk-khkv9s5c.js"),U=process.stderr.isTTY;process.stderr.write("Performing one time database migration, may take a few minutes..."+LD);let Q=-1;if(U)process.stderr.write("\x1B[?25l");try{await G.run(Y({client:J.Client().$client}),{progress:(X)=>{let O=Math.floor(X.current/X.total*100);if(O===Q&&X.current!==X.total)return;if(Q=O,U){if(process.stderr.write(s0(O,`${X.label.padEnd(12)} ${X.current}/${X.total}`)),X.current===X.total)process.stderr.write(`
81
- `)}else process.stderr.write(`sqlite-migration:${O}${LD}`)}})}finally{if(U)process.stderr.write("\x1B[?25h");else process.stderr.write(`sqlite-migration:done${LD}`)}process.stderr.write("Database migration complete."+LD)}if(!process.env.QITQODE_DISABLE_CLAUDE_IMPORT&&!process.env.QITQODE_CLAUDE_IMPORTED){process.env.QITQODE_CLAUDE_IMPORTED="1";let G=async()=>{try{let{ClaudeImport:U}=await import("./chunk-3fzgbam3.js");await U.run()}catch(U){u.Default.warn("claude-import failed",{e:GF(U)})}},J=$F(VD);if(!J||!(J in _u))G();else await G()}}).usage("").completion("completion","generate shell completion script");for(let D of await Z8(VD))Mu.command(D);Mu.fail((D,u)=>{if(D?.startsWith("Unknown argument")||D?.startsWith("Not enough non-option arguments")||D?.startsWith("Invalid values:")){if(u)throw u;Mu.showHelp(r0)}if(u)throw u;process.exit(1)}).strict();try{if(VD.includes("-h")||VD.includes("--help"))await Mu.parse(VD,(D,u,F)=>{if(D)throw D;if(!F)return;r0(F)});else await Mu.parse()}catch(D){let u={};if(D instanceof i0){let C=D.toObject();Object.assign(u,{...C.data})}if(D instanceof Error)Object.assign(u,{name:D.name,message:D.message,cause:D.cause?.toString(),stack:D.stack});if(D instanceof ResolveMessage)Object.assign(u,{name:D.name,message:D.message,code:D.code,specifier:D.specifier,referrer:D.referrer,position:D.position,importKind:D.importKind});let F=await import("./chunk-w8rvjbgr.js");F.Default.error("fatal",u);let E=d0(D);if(E)Ku.error(E);if(E===void 0)Ku.error("Unexpected error, check log file at "+F.file()+" for more details"+LD),process.stderr.write(GF(D)+LD);process.exitCode=1}finally{process.exit()}
80
+ `,"f");H(this,$D,B(this,$D,"f")+D.join(" "),"f")}}}[su](D){Du(B(this,K,"f")).forEach((u)=>{if(((E)=>E==="configObjects")(u))return;let F=B(this,K,"f")[u];if(Array.isArray(F)){if(F.includes(D))F.splice(F.indexOf(D),1)}else if(typeof F==="object")delete F[D]}),delete B(this,b,"f").getDescriptions()[D]}[R0](D,u,F){if(!B(this,Uu,"f")[F])B(this,P,"f").process.emitWarning(D,u),B(this,Uu,"f")[F]=!0}[j0](){B(this,Nu,"f").push({options:B(this,K,"f"),configObjects:B(this,K,"f").configObjects.slice(0),exitProcess:B(this,WD,"f"),groups:B(this,HD,"f"),strict:B(this,kD,"f"),strictCommands:B(this,gD,"f"),strictOptions:B(this,lD,"f"),completionCommand:B(this,QD,"f"),output:B(this,$D,"f"),exitError:B(this,wD,"f"),hasOutput:B(this,OD,"f"),parsed:this.parsed,parseFn:B(this,TD,"f"),parseContext:B(this,dD,"f")}),B(this,b,"f").freeze(),B(this,r,"f").freeze(),B(this,uD,"f").freeze(),B(this,UD,"f").freeze()}[q0](){let D="",u;if(/\b(node|iojs|electron)(\.exe)?$/.test(B(this,P,"f").process.argv()[0]))u=B(this,P,"f").process.argv().slice(1,2);else u=B(this,P,"f").process.argv().slice(0,1);if(D=u.map((F)=>{let E=this[t0](B(this,vD,"f"),F);return F.match(/^(\/|([a-zA-Z]:)?\\)/)&&E.length<F.length?E:F}).join(" ").trim(),B(this,P,"f").getEnv("_")&&B(this,P,"f").getProcessArgvBin()===B(this,P,"f").getEnv("_"))D=B(this,P,"f").getEnv("_").replace(`${B(this,P,"f").path.dirname(B(this,P,"f").process.execPath())}/`,"");return D}[yD](){return B(this,qu,"f")}[H0](){return B(this,Iu,"f")}[ru](){if(!B(this,mD,"f"))return;let D=B(this,P,"f").getEnv("LC_ALL")||B(this,P,"f").getEnv("LC_MESSAGES")||B(this,P,"f").getEnv("LANG")||B(this,P,"f").getEnv("LANGUAGE")||"en_US";this.locale(D.replace(/[.:].*/,""))}[I0](){return this[au]().version||"unknown"}[V0](D){let u=D["--"]?D["--"]:D._;for(let F=0,E;(E=u[F])!==void 0;F++)if(B(this,P,"f").Parser.looksLikeNumber(E)&&Number.isSafeInteger(Math.floor(parseFloat(`${E}`))))u[F]=Number(E);return D}[au](D){let u=D||"*";if(B(this,Fu,"f")[u])return B(this,Fu,"f")[u];let F={};try{let E=D||B(this,P,"f").mainFilename;if(B(this,P,"f").path.extname(E))E=B(this,P,"f").path.dirname(E);let C=B(this,P,"f").findUp(E,(f,h)=>{if(h.includes("package.json"))return"package.json";else return});XD(C,void 0,B(this,P,"f")),F=JSON.parse(B(this,P,"f").readFileSync(C,"utf8"))}catch(E){}return B(this,Fu,"f")[u]=F||{},B(this,Fu,"f")[u]}[tD](D,u){u=[].concat(u),u.forEach((F)=>{F=this[uF](F),B(this,K,"f")[D].push(F)})}[Eu](D,u,F,E){this[DF](D,u,F,E,(C,f,h)=>{B(this,K,"f")[C][f]=h})}[eu](D,u,F,E){this[DF](D,u,F,E,(C,f,h)=>{B(this,K,"f")[C][f]=(B(this,K,"f")[C][f]||[]).concat(h)})}[DF](D,u,F,E,C){if(Array.isArray(F))F.forEach((f)=>{D(f,E)});else if(((f)=>typeof f==="object")(F))for(let f of Du(F))D(f,F[f]);else C(u,this[uF](F),E)}[uF](D){if(D==="__proto__")return"___proto___";return D}[FF](D,u){return this[Eu](this[FF].bind(this),"key",D,u),this}[EF](){var D,u,F,E,C,f,h,G,J,Y,U,Q;let X=B(this,Nu,"f").pop();XD(X,void 0,B(this,P,"f"));let O;D=this,u=this,F=this,E=this,C=this,f=this,h=this,G=this,J=this,Y=this,U=this,Q=this,{options:{set value(W){H(D,K,W,"f")}}.value,configObjects:O,exitProcess:{set value(W){H(u,WD,W,"f")}}.value,groups:{set value(W){H(F,HD,W,"f")}}.value,output:{set value(W){H(E,$D,W,"f")}}.value,exitError:{set value(W){H(C,wD,W,"f")}}.value,hasOutput:{set value(W){H(f,OD,W,"f")}}.value,parsed:this.parsed,strict:{set value(W){H(h,kD,W,"f")}}.value,strictCommands:{set value(W){H(G,gD,W,"f")}}.value,strictOptions:{set value(W){H(J,lD,W,"f")}}.value,completionCommand:{set value(W){H(Y,QD,W,"f")}}.value,parseFn:{set value(W){H(U,TD,W,"f")}}.value,parseContext:{set value(W){H(Q,dD,W,"f")}}.value}=X,B(this,K,"f").configObjects=O,B(this,b,"f").unfreeze(),B(this,r,"f").unfreeze(),B(this,uD,"f").unfreeze(),B(this,UD,"f").unfreeze()}[_0](D,u){return pD(u,(F)=>{return D(F),F})}getInternalMethods(){return{getCommandInstance:this[K0].bind(this),getContext:this[L0].bind(this),getHasOutput:this[A0].bind(this),getLoggerInstance:this[S0].bind(this),getParseContext:this[x0].bind(this),getParserConfiguration:this[yD].bind(this),getUsageConfiguration:this[H0].bind(this),getUsageInstance:this[P0].bind(this),getValidationInstance:this[w0].bind(this),hasParseCallback:this[Vu].bind(this),isGlobalContext:this[b0].bind(this),postProcess:this[sD].bind(this),reset:this[CF].bind(this),runValidation:this[BF].bind(this),runYargsParserAndExecuteCommands:this[Gu].bind(this),setHasOutput:this[n0].bind(this)}}[K0](){return B(this,uD,"f")}[L0](){return B(this,zu,"f")}[A0](){return B(this,OD,"f")}[S0](){return B(this,iD,"f")}[x0](){return B(this,dD,"f")||{}}[P0](){return B(this,b,"f")}[w0](){return B(this,r,"f")}[Vu](){return!!B(this,TD,"f")}[b0](){return B(this,Ru,"f")}[sD](D,u,F,E){if(F)return D;if(l(D))return D;if(!u)D=this[U0](D);if(this[yD]()["parse-positional-numbers"]||this[yD]()["parse-positional-numbers"]===void 0)D=this[V0](D);if(E)D=cD(D,this,B(this,UD,"f").getMiddleware(),!1);return D}[CF](D={}){H(this,K,B(this,K,"f")||{},"f");let u={};u.local=B(this,K,"f").local||[],u.configObjects=B(this,K,"f").configObjects||[];let F={};u.local.forEach((f)=>{F[f]=!0,(D[f]||[]).forEach((h)=>{F[h]=!0})}),Object.assign(B(this,oD,"f"),Object.keys(B(this,HD,"f")).reduce((f,h)=>{let G=B(this,HD,"f")[h].filter((J)=>!(J in F));if(G.length>0)f[h]=G;return f},{})),H(this,HD,{},"f");let E=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],C=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];if(E.forEach((f)=>{u[f]=(B(this,K,"f")[f]||[]).filter((h)=>!F[h])}),C.forEach((f)=>{u[f]=xD(B(this,K,"f")[f],(h)=>!F[h])}),u.envPrefix=B(this,K,"f").envPrefix,H(this,K,u,"f"),H(this,b,B(this,b,"f")?B(this,b,"f").reset(F):M0(this,B(this,P,"f")),"f"),H(this,r,B(this,r,"f")?B(this,r,"f").reset(F):Y0(this,B(this,b,"f"),B(this,P,"f")),"f"),H(this,uD,B(this,uD,"f")?B(this,uD,"f").reset():$0(B(this,b,"f"),B(this,r,"f"),B(this,UD,"f"),B(this,P,"f")),"f"),!B(this,ZD,"f"))H(this,ZD,Q0(this,B(this,b,"f"),B(this,uD,"f"),B(this,P,"f")),"f");return B(this,UD,"f").reset(),H(this,QD,null,"f"),H(this,$D,"","f"),H(this,wD,null,"f"),H(this,OD,!1,"f"),this.parsed=!1,this}[t0](D,u){return B(this,P,"f").path.relative(D,u)}[Gu](D,u,F,E=0,C=!1){var f,h,G,J;let Y=!!F||C;D=D||B(this,bD,"f"),B(this,K,"f").__=B(this,P,"f").y18n.__,B(this,K,"f").configuration=this[yD]();let U=!!B(this,K,"f").configuration["populate--"],Q=Object.assign({},B(this,K,"f").configuration,{"populate--":!0}),X=B(this,P,"f").Parser.detailed(D,Object.assign({},B(this,K,"f"),{configuration:{"parse-positional-numbers":!1,...Q}})),O=Object.assign(X.argv,B(this,dD,"f")),W=void 0,Z=X.aliases,A=!1,v=!1;if(Object.keys(O).forEach((n)=>{if(n===B(this,ND,"f")&&O[n])A=!0;else if(n===B(this,ID,"f")&&O[n])v=!0}),O.$0=this.$0,this.parsed=X,E===0)B(this,b,"f").clearCachedHelpMessage();try{if(this[ru](),u)return this[sD](O,U,!!F,!1);if(B(this,ND,"f")){if([B(this,ND,"f")].concat(Z[B(this,ND,"f")]||[]).filter((ED)=>ED.length>1).includes(""+O._[O._.length-1]))O._.pop(),A=!0}H(this,Ru,!1,"f");let n=B(this,uD,"f").getCommands(),GD=((f=B(this,ZD,"f"))===null||f===void 0?void 0:f.completionKey)?[(h=B(this,ZD,"f"))===null||h===void 0?void 0:h.completionKey,...(J=this.getAliases()[(G=B(this,ZD,"f"))===null||G===void 0?void 0:G.completionKey])!==null&&J!==void 0?J:[]].some((g)=>Object.prototype.hasOwnProperty.call(O,g)):!1,t=A||GD||C;if(O._.length){if(n.length){let g;for(let ED=E||0,a;O._[ED]!==void 0;ED++)if(a=String(O._[ED]),n.includes(a)&&a!==B(this,QD,"f")){let qD=B(this,uD,"f").runCommand(a,this,X,ED+1,C,A||v||C);return this[sD](qD,U,!!F,!1)}else if(!g&&a!==B(this,QD,"f")){g=a;break}if(!B(this,uD,"f").hasDefaultCommand()&&B(this,Hu,"f")&&g&&!t)B(this,r,"f").recommendCommands(g,n)}if(B(this,QD,"f")&&O._.includes(B(this,QD,"f"))&&!GD){if(B(this,WD,"f"))PD(!0);this.showCompletionScript(),this.exit(0)}}if(B(this,uD,"f").hasDefaultCommand()&&!t){let g=B(this,uD,"f").runCommand(null,this,X,0,C,A||v||C);return this[sD](g,U,!!F,!1)}if(GD){if(B(this,WD,"f"))PD(!0);D=[].concat(D);let g=D.slice(D.indexOf(`--${B(this,ZD,"f").completionKey}`)+1);return B(this,ZD,"f").getCompletion(g,(ED,a)=>{if(ED)throw new DD(ED.message);(a||[]).forEach((qD)=>{B(this,iD,"f").log(qD)}),this.exit(0)}),this[sD](O,!U,!!F,!1)}if(!B(this,OD,"f")){if(A){if(B(this,WD,"f"))PD(!0);Y=!0,this.showHelp((g)=>{B(this,iD,"f").log(g),this.exit(0)})}else if(v){if(B(this,WD,"f"))PD(!0);Y=!0,B(this,b,"f").showVersion("log"),this.exit(0)}}if(!Y&&B(this,K,"f").skipValidation.length>0)Y=Object.keys(O).some((g)=>B(this,K,"f").skipValidation.indexOf(g)>=0&&O[g]===!0);if(!Y){if(X.error)throw new DD(X.error.message);if(!GD){let g=this[BF](Z,{},X.error);if(!F)W=cD(O,this,B(this,UD,"f").getMiddleware(),!0);if(W=this[_0](g,W!==null&&W!==void 0?W:O),l(W)&&!F)W=W.then(()=>{return cD(O,this,B(this,UD,"f").getMiddleware(),!1)})}}}catch(n){if(n instanceof DD)B(this,b,"f").fail(n.message,n);else throw n}return this[sD](W!==null&&W!==void 0?W:O,U,!!F,!0)}[BF](D,u,F,E){let C={...this.getDemandedOptions()};return(f)=>{if(F)throw new DD(F.message);B(this,r,"f").nonOptionCount(f),B(this,r,"f").requiredArguments(f,C);let h=!1;if(B(this,gD,"f"))h=B(this,r,"f").unknownCommands(f);if(B(this,kD,"f")&&!h)B(this,r,"f").unknownArguments(f,D,u,!!E);else if(B(this,lD,"f"))B(this,r,"f").unknownArguments(f,D,{},!1,!1);B(this,r,"f").limitedChoices(f),B(this,r,"f").implications(f),B(this,r,"f").conflicting(f)}}[n0](){H(this,OD,!0,"f")}[rD](D){if(typeof D==="string")B(this,K,"f").key[D]=!0;else for(let u of D)B(this,K,"f").key[u]=!0}}function z0(D){return!!D&&typeof D.getInternalMethods==="function"}var z8=c0(ou),v0=z8;import{EOL as LD}from"os";import G8 from"path";var m0=o0("main");k0("main");var VD=iu(process.argv);if(VD.length===1&&(VD[0]==="--version"||VD[0]==="-v"))process.stdout.write(zF+LD),process.exit();var _u={acp:()=>import("./chunk-r0zsgad8.js").then((D)=>D.AcpCommand),mcp:()=>import("./chunk-x8w2xgx6.js").then((D)=>D.McpCommand),attach:()=>import("./chunk-c6wrjyep.js").then((D)=>D.AttachCommand),run:()=>import("./chunk-qwf258sw.js").then((D)=>D.RunCommand),generate:()=>import("./chunk-f03yje8k.js").then((D)=>D.GenerateCommand),debug:()=>import("./chunk-5a80qybt.js").then((D)=>D.DebugCommand),console:()=>import("./chunk-fssgbz70.js").then((D)=>D.ConsoleCommand),providers:()=>import("./chunk-anqjy235.js").then((D)=>D.ProvidersCommand),agent:()=>import("./chunk-rpy4rgmm.js").then((D)=>D.AgentCommand),upgrade:()=>import("./chunk-k9m536te.js").then((D)=>D.UpgradeCommand),uninstall:()=>import("./chunk-x4b0ywbs.js").then((D)=>D.UninstallCommand),serve:()=>import("./chunk-rbrkvj3x.js").then((D)=>D.ServeCommand),models:()=>import("./chunk-r4hkkcj4.js").then((D)=>D.ModelsCommand),stats:()=>import("./chunk-ht1hqsaa.js").then((D)=>D.StatsCommand),usage:()=>import("./chunk-rry321tn.js").then((D)=>D.UsageCommand),export:()=>import("./chunk-dgsg31vm.js").then((D)=>D.ExportCommand),import:()=>import("./chunk-fyd31m33.js").then((D)=>D.ImportCommand),github:()=>import("./chunk-mbkw9s6e.js").then((D)=>D.GithubCommand),pr:()=>import("./chunk-t8365msg.js").then((D)=>D.PrCommand),session:()=>import("./chunk-btjcs9ee.js").then((D)=>D.SessionCommand),plugin:()=>import("./chunk-msqx5bb0.js").then((D)=>D.PluginCommand),plug:()=>import("./chunk-msqx5bb0.js").then((D)=>D.PluginCommand),auth:()=>import("./chunk-eb0ksh4x.js").then((D)=>D.AuthCommand),qredits:()=>import("./chunk-dcyzpkww.js").then((D)=>D.QreditsCommand),db:()=>import("./chunk-6hkv9411.js").then((D)=>D.DbCommand),default:()=>import("./chunk-bn6mg34g.js").then((D)=>D.TuiThreadCommand)};function s(D,u,F){return{command:D,describe:u,aliases:F,handler:async()=>{}}}function fF(){return[s("acp","start ACP (Agent Client Protocol) server"),s("mcp","manage MCP (Model Context Protocol) servers"),{command:"$0 [project]",describe:"start qitqode tui",builder:(D)=>D.positional("project",{type:"string",describe:"path to start qitqode in"}).options(l0).options(y0).option("never-ask",{type:"boolean",describe:"start in never-ask mode, auto-decide without asking (permissions excluded)",default:!1}).option("trust",{type:"boolean",describe:"skip workspace trust prompt and trust the directory",default:!1}),handler:async()=>{}},s("attach <url>","attach to a running qitqode server"),s("run [message..]","run qitqode with a message"),s("generate","generate files"),s("debug","debugging and troubleshooting tools"),s("console","manage qitqode accounts"),s("providers","manage AI providers and credentials",["auth"]),s("agent","manage agents"),s("upgrade [target]","upgrade qitqode to the latest or a specific version"),s("uninstall","uninstall qitqode and remove all related files"),s("serve","starts a headless qitqode server"),s("models [provider]","list all available models"),s("stats","show token usage and cost statistics"),s("usage [sessionID]","show per-turn token usage and cost"),s("export [sessionID]","export session data as JSON"),s("import <file>","import session data from JSON file or URL"),s("github","manage GitHub agent"),s("pr <number>","fetch and checkout a GitHub PR branch, then run qitqode"),s("session","manage sessions"),s("plugin <module>","install plugin and update config",["plug"]),s("auth <command>","Sign in or out of Forgewise"),s("qredits <command>","Check Qredits balance and spend history"),s("db","database tools")]}function $F(D){let u=new Set(["--log-level","--model","-m","--session","-s","--prompt","--agent","--port","--hostname","--mdns-domain","--cors"]);for(let F=0;F<D.length;F++){let E=D[F];if(E==="--")return;if(E.startsWith("-")){if(u.has(E))F++;continue}return E}}function M8(D){return D.length>0&&D.every((u)=>u==="--help"||u==="-h")}function X8(D){return D.includes("--help")||D.includes("-h")}async function Z8(D){let u=$F(D);if(D.includes("--get-yargs-completions")||u==="completion")return fF();if(M8(D))return fF();else if(u&&u in _u)return[await _u[u]()];else if(X8(D))return fF();else return[await _u.default()]}function r0(D){let u=D.trimStart();if(!u.startsWith("qitqode ")){process.stderr.write(Ku.logo()+LD+LD),process.stderr.write(u);return}process.stderr.write(D)}var Mu=g0(v0(VD)).middleware(async(D)=>{if(D.pure)process.env.QITQODE_PURE="1";let u=await import("./chunk-9ac4h2d9.js"),{Filesystem:F}=await import("./chunk-kv58j3yk.js"),{Heap:E}=await import("./chunk-04ezvjjf.js"),{Global:C}=await import("./chunk-7az1bpy8.js");await u.init({print:process.argv.includes("--print-logs"),dev:hF,level:(()=>{if(D.logLevel)return D.logLevel;if(hF)return"DEBUG";return"INFO"})()}),E.start(),(await import("./chunk-fydd2nmw.js")).startRefresh(),process.env.AGENT="1",process.env.QITQODE="1",process.env.QITQODE_PID=String(process.pid),u.Default.info("qitqode",{version:zF,command:$F(VD)??"tui",process_role:m0.processRole,run_id:m0.runID});let h=G8.join(C.Path.data,"qitqode.db");if(!await F.exists(h)){let{JsonMigration:G,Database:J}=await import("./chunk-vvs87e61.js"),{drizzle:Y}=await import("./chunk-khkv9s5c.js"),U=process.stderr.isTTY;process.stderr.write("Performing one time database migration, may take a few minutes..."+LD);let Q=-1;if(U)process.stderr.write("\x1B[?25l");try{await G.run(Y({client:J.Client().$client}),{progress:(X)=>{let O=Math.floor(X.current/X.total*100);if(O===Q&&X.current!==X.total)return;if(Q=O,U){if(process.stderr.write(s0(O,`${X.label.padEnd(12)} ${X.current}/${X.total}`)),X.current===X.total)process.stderr.write(`
81
+ `)}else process.stderr.write(`sqlite-migration:${O}${LD}`)}})}finally{if(U)process.stderr.write("\x1B[?25h");else process.stderr.write(`sqlite-migration:done${LD}`)}process.stderr.write("Database migration complete."+LD)}if(!process.env.QITQODE_DISABLE_CLAUDE_IMPORT&&!process.env.QITQODE_CLAUDE_IMPORTED){process.env.QITQODE_CLAUDE_IMPORTED="1";let G=async()=>{try{let{ClaudeImport:U}=await import("./chunk-v07wtbmt.js");await U.run()}catch(U){u.Default.warn("claude-import failed",{e:GF(U)})}},J=$F(VD);if(!J||!(J in _u))G();else await G()}}).usage("").completion("completion","generate shell completion script");for(let D of await Z8(VD))Mu.command(D);Mu.fail((D,u)=>{if(D?.startsWith("Unknown argument")||D?.startsWith("Not enough non-option arguments")||D?.startsWith("Invalid values:")){if(u)throw u;Mu.showHelp(r0)}if(u)throw u;process.exit(1)}).strict();try{if(VD.includes("-h")||VD.includes("--help"))await Mu.parse(VD,(D,u,F)=>{if(D)throw D;if(!F)return;r0(F)});else await Mu.parse()}catch(D){let u={};if(D instanceof i0){let C=D.toObject();Object.assign(u,{...C.data})}if(D instanceof Error)Object.assign(u,{name:D.name,message:D.message,cause:D.cause?.toString(),stack:D.stack});if(D instanceof ResolveMessage)Object.assign(u,{name:D.name,message:D.message,code:D.code,specifier:D.specifier,referrer:D.referrer,position:D.position,importKind:D.importKind});let F=await import("./chunk-9ac4h2d9.js");F.Default.error("fatal",u);let E=d0(D);if(E)Ku.error(E);if(E===void 0)Ku.error("Unexpected error, check log file at "+F.file()+" for more details"+LD),process.stderr.write(GF(D)+LD);process.exitCode=1}finally{process.exit()}
package/bundle/worker.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Uf as H}from"./chunk-c4mxtqyq.js";import{Zf as x}from"./chunk-qq48ffjc.js";import"./chunk-rmmrnx95.js";import"./chunk-5549c7mb.js";import"./chunk-pn77fh9b.js";import"./chunk-hkqcpdmt.js";import"./chunk-nfg7nt13.js";import"./chunk-awdpkgxf.js";import"./chunk-xb031er5.js";import{Wg as V,qh as O}from"./chunk-1qw3yh13.js";import"./chunk-ckhhm2m8.js";import"./chunk-tp7sfreh.js";import"./chunk-q6x5bmc3.js";import"./chunk-n1m5qdf5.js";import"./chunk-zeh3mjgp.js";import"./chunk-prrrw8t8.js";import"./chunk-tz8qhbk9.js";import"./chunk-k19zvbzh.js";import{Cj as Y,fl as Z}from"./chunk-q39h31te.js";import{hl as N}from"./chunk-0x0a51w3.js";import{Pl as q,sl as C}from"./chunk-7myavy3p.js";import"./chunk-fegrrsfj.js";import"./chunk-c4x99ayd.js";import"./chunk-w0fg8n1f.js";import"./chunk-0pbpzty2.js";import"./chunk-w8xaw2dv.js";import"./chunk-tq258v8s.js";import"./chunk-jc0wbpjq.js";import"./chunk-jfy6bfvv.js";import"./chunk-aej69zjj.js";import"./chunk-98nh88th.js";import"./chunk-t7v8wzr9.js";import"./chunk-er5q8nhp.js";import"./chunk-cqtkxwd8.js";import"./chunk-h6htvj2y.js";import"./chunk-2qy62cv4.js";import"./chunk-t2n6fmpy.js";import"./chunk-x1naayst.js";import"./chunk-ng85b73s.js";import"./chunk-351wfvhp.js";import"./chunk-hmm1m733.js";import"./chunk-k5vwx1nv.js";import"./chunk-ej3gmaba.js";import"./chunk-3nc9wy1m.js";import"./chunk-r8ddb02d.js";import"./chunk-dhvwrrqx.js";import{Cs as k}from"./chunk-s2g5989e.js";import"./chunk-56cty7nr.js";import"./chunk-thbjhgw0.js";import{Gs as X,Is as G,Ms as j,Ys as z,dt as T,mt as W}from"./chunk-v7yvnnmr.js";import"./chunk-b5x3zghc.js";import"./chunk-t1f7jeat.js";import"./chunk-tk6gjy9d.js";import"./chunk-pkdk0ppc.js";import"./chunk-hrnx60em.js";import"./chunk-bbznk59q.js";import"./chunk-01gtn79f.js";import"./chunk-meaa7wrs.js";import"./chunk-0ddhkapd.js";import"./chunk-gvj8qg7x.js";import"./chunk-fa03gsff.js";var $=W.create({service:"upgrade"});function L(D,E){if(D===!1)return"disabled";if(D===!0&&E==="patch")return"install";return"notify"}async function M(){if(G)return;let D=await O.runPromise(Z.Service.use((J)=>J.getGlobal())),E=await O.runPromise(N.Service.use((J)=>J.method())),K=await O.runPromise(N.Service.use((J)=>J.latest(E))).catch((J)=>{$.warn("failed to check for updates",{method:E,error:String(J)})});if(!K)return;if(!N.isNewerVersion(X,K)){$.warn("ignoring non-newer update version",{current:X,latest:K});return}if(T.QITQODE_ALWAYS_NOTIFY_UPDATE){await Y.publish(N.Event.UpdateAvailable,{version:K});return}if(T.QITQODE_DISABLE_AUTOUPDATE)return;let _=N.getReleaseType(X,K),Q=L(D.autoupdate,_);if(Q==="disabled")return;if(Q==="notify"){await Y.publish(N.Event.UpdateAvailable,{version:K});return}if(E==="unknown")return;await O.runPromise(N.Service.use((J)=>J.upgrade(E,K))).then(()=>Y.publish(N.Event.Updated,{version:K})).catch((J)=>{$.warn("auto-upgrade failed",{method:E,target:K,error:String(J)})})}import{writeHeapSnapshot as P}from"v8";j("worker");await W.init({print:process.argv.includes("--print-logs"),dev:N.isLocal(),level:(()=>{if(N.isLocal())return"DEBUG";return"INFO"})()});H.start();k("worker");C.on("event",(D)=>{z.emit("global.event",D)});var U,S={async fetch(D){let E={...D.headers},K=w();if(K&&!E.authorization&&!E.Authorization)E.Authorization=K;let _=new Request(D.url,{method:D.method,headers:E,body:D.body}),Q=await x.Default().app.fetch(_),J=await Q.text();return{status:Q.status,headers:Object.fromEntries(Q.headers.entries()),body:J}},snapshot(){return P("server.heapsnapshot")},async server(D){if(U)await U.stop(!0);return U=await x.listen(D),{url:U.url.toString()}},async checkUpgrade(D){await q.provide({directory:D.directory,init:()=>O.runPromise(V),fn:async()=>{await M().catch(()=>{})}})},async reload(){await O.runPromise(Z.Service.use((D)=>D.invalidate(!0)))},async shutdown(){if(W.Default.info("worker shutting down"),await q.disposeAll(),U)await U.stop(!0)}};z.listen(S);function w(){let D=T.QITQODE_SERVER_PASSWORD;if(!D)return;let E=T.QITQODE_SERVER_USERNAME??"qitqode";return`Basic ${btoa(`${E}:${D}`)}`}export{S as rpc};
2
+ import{Uf as H}from"./chunk-8r4xs1q9.js";import{Zf as x}from"./chunk-h5wh2d49.js";import"./chunk-xjdxyeja.js";import"./chunk-1zb95qfx.js";import"./chunk-cckshvkb.js";import"./chunk-hkqcpdmt.js";import"./chunk-nfg7nt13.js";import"./chunk-awdpkgxf.js";import"./chunk-8x6x3g16.js";import{Wg as V,qh as O}from"./chunk-0jv8r99k.js";import"./chunk-th189x63.js";import"./chunk-k6eyc1wv.js";import"./chunk-q6x5bmc3.js";import"./chunk-n1m5qdf5.js";import"./chunk-zeh3mjgp.js";import"./chunk-prrrw8t8.js";import"./chunk-tz8qhbk9.js";import"./chunk-k19zvbzh.js";import{Cj as Y,fl as Z}from"./chunk-3f6t3wde.js";import{hl as N}from"./chunk-b5h8vd5n.js";import{Pl as q,sl as C}from"./chunk-jee9y4t0.js";import"./chunk-50aznc8e.js";import"./chunk-c4x99ayd.js";import"./chunk-73d0dy03.js";import"./chunk-ha5qct06.js";import"./chunk-w8xaw2dv.js";import"./chunk-tq258v8s.js";import"./chunk-ds162xgb.js";import"./chunk-jfy6bfvv.js";import"./chunk-2p6w3w8f.js";import"./chunk-98nh88th.js";import"./chunk-t7v8wzr9.js";import"./chunk-er5q8nhp.js";import"./chunk-cqtkxwd8.js";import"./chunk-h6htvj2y.js";import"./chunk-2qy62cv4.js";import"./chunk-t2n6fmpy.js";import"./chunk-x1naayst.js";import"./chunk-ng85b73s.js";import"./chunk-351wfvhp.js";import"./chunk-hmm1m733.js";import"./chunk-2bxy8zm1.js";import"./chunk-qq9pvscd.js";import"./chunk-3nc9wy1m.js";import"./chunk-r8ddb02d.js";import"./chunk-dhvwrrqx.js";import{Cs as k}from"./chunk-n39gqxkz.js";import"./chunk-56cty7nr.js";import"./chunk-thbjhgw0.js";import{Gs as X,Is as G,Ms as j,Ys as z,dt as T,mt as W}from"./chunk-p20ft5mj.js";import"./chunk-b5x3zghc.js";import"./chunk-t1f7jeat.js";import"./chunk-tk6gjy9d.js";import"./chunk-pkdk0ppc.js";import"./chunk-hrnx60em.js";import"./chunk-bbznk59q.js";import"./chunk-01gtn79f.js";import"./chunk-meaa7wrs.js";import"./chunk-0ddhkapd.js";import"./chunk-gvj8qg7x.js";import"./chunk-fa03gsff.js";var $=W.create({service:"upgrade"});function L(D,E){if(D===!1)return"disabled";if(D===!0&&E==="patch")return"install";return"notify"}async function M(){if(G)return;let D=await O.runPromise(Z.Service.use((J)=>J.getGlobal())),E=await O.runPromise(N.Service.use((J)=>J.method())),K=await O.runPromise(N.Service.use((J)=>J.latest(E))).catch((J)=>{$.warn("failed to check for updates",{method:E,error:String(J)})});if(!K)return;if(!N.isNewerVersion(X,K)){$.warn("ignoring non-newer update version",{current:X,latest:K});return}if(T.QITQODE_ALWAYS_NOTIFY_UPDATE){await Y.publish(N.Event.UpdateAvailable,{version:K});return}if(T.QITQODE_DISABLE_AUTOUPDATE)return;let _=N.getReleaseType(X,K),Q=L(D.autoupdate,_);if(Q==="disabled")return;if(Q==="notify"){await Y.publish(N.Event.UpdateAvailable,{version:K});return}if(E==="unknown")return;await O.runPromise(N.Service.use((J)=>J.upgrade(E,K))).then(()=>Y.publish(N.Event.Updated,{version:K})).catch((J)=>{$.warn("auto-upgrade failed",{method:E,target:K,error:String(J)})})}import{writeHeapSnapshot as P}from"v8";j("worker");await W.init({print:process.argv.includes("--print-logs"),dev:N.isLocal(),level:(()=>{if(N.isLocal())return"DEBUG";return"INFO"})()});H.start();k("worker");C.on("event",(D)=>{z.emit("global.event",D)});var U,S={async fetch(D){let E={...D.headers},K=w();if(K&&!E.authorization&&!E.Authorization)E.Authorization=K;let _=new Request(D.url,{method:D.method,headers:E,body:D.body}),Q=await x.Default().app.fetch(_),J=await Q.text();return{status:Q.status,headers:Object.fromEntries(Q.headers.entries()),body:J}},snapshot(){return P("server.heapsnapshot")},async server(D){if(U)await U.stop(!0);return U=await x.listen(D),{url:U.url.toString()}},async checkUpgrade(D){await q.provide({directory:D.directory,init:()=>O.runPromise(V),fn:async()=>{await M().catch(()=>{})}})},async reload(){await O.runPromise(Z.Service.use((D)=>D.invalidate(!0)))},async shutdown(){if(W.Default.info("worker shutting down"),await q.disposeAll(),U)await U.stop(!0)}};z.listen(S);function w(){let D=T.QITQODE_SERVER_PASSWORD;if(!D)return;let E=T.QITQODE_SERVER_USERNAME??"qitqode";return`Basic ${btoa(`${E}:${D}`)}`}export{S as rpc};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qitqode/qitqode-android-arm64",
3
- "version": "0.1.20",
3
+ "version": "0.1.22",
4
4
  "description": "Android arm64 runtime for @qitqode/cli.",
5
5
  "license": "MIT",
6
6
  "author": "QitQode",
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{el as a}from"./chunk-q39h31te.js";import"./chunk-0x0a51w3.js";import"./chunk-7myavy3p.js";import"./chunk-fegrrsfj.js";import"./chunk-c4x99ayd.js";import"./chunk-w0fg8n1f.js";import"./chunk-0pbpzty2.js";import"./chunk-w8xaw2dv.js";import"./chunk-tq258v8s.js";import"./chunk-jc0wbpjq.js";import"./chunk-jfy6bfvv.js";import"./chunk-aej69zjj.js";import"./chunk-98nh88th.js";import"./chunk-t7v8wzr9.js";import"./chunk-er5q8nhp.js";import"./chunk-cqtkxwd8.js";import"./chunk-h6htvj2y.js";import"./chunk-2qy62cv4.js";import"./chunk-t2n6fmpy.js";import"./chunk-x1naayst.js";import"./chunk-ng85b73s.js";import"./chunk-k5vwx1nv.js";import"./chunk-ej3gmaba.js";import"./chunk-3nc9wy1m.js";import"./chunk-r8ddb02d.js";import"./chunk-dhvwrrqx.js";import"./chunk-56cty7nr.js";import"./chunk-thbjhgw0.js";import"./chunk-v7yvnnmr.js";import"./chunk-b5x3zghc.js";import"./chunk-t1f7jeat.js";import"./chunk-tk6gjy9d.js";import"./chunk-pkdk0ppc.js";import"./chunk-hrnx60em.js";import"./chunk-bbznk59q.js";import"./chunk-01gtn79f.js";import"./chunk-meaa7wrs.js";import"./chunk-gvj8qg7x.js";import"./chunk-fa03gsff.js";export{a as Session};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{m as a}from"./chunk-gfm4vad7.js";import"./chunk-3makpbng.js";import"./chunk-8k1q3g8s.js";import"./chunk-3w60y2x5.js";import"./chunk-wnjg8mmh.js";import"./chunk-jj7wrfty.js";import"./chunk-43xq4p51.js";import"./chunk-3degq6rv.js";import"./chunk-fgqrcjsm.js";import"./chunk-fd1vbz1f.js";import"./chunk-7b69jj5g.js";import"./chunk-x1dfc7qd.js";import"./chunk-en7nxqvn.js";import"./chunk-v9sfzkg5.js";import"./chunk-djcsvcby.js";import"./chunk-ntmn6epc.js";import"./chunk-5549c7mb.js";import"./chunk-pn77fh9b.js";import"./chunk-ckhhm2m8.js";import"./chunk-tp7sfreh.js";import"./chunk-tz8qhbk9.js";import"./chunk-q39h31te.js";import"./chunk-0x0a51w3.js";import"./chunk-7myavy3p.js";import"./chunk-fegrrsfj.js";import"./chunk-c4x99ayd.js";import"./chunk-w0fg8n1f.js";import"./chunk-0pbpzty2.js";import"./chunk-w8xaw2dv.js";import"./chunk-tq258v8s.js";import"./chunk-jc0wbpjq.js";import"./chunk-jfy6bfvv.js";import"./chunk-aej69zjj.js";import"./chunk-98nh88th.js";import"./chunk-t7v8wzr9.js";import"./chunk-er5q8nhp.js";import"./chunk-cqtkxwd8.js";import"./chunk-h6htvj2y.js";import"./chunk-2qy62cv4.js";import"./chunk-t2n6fmpy.js";import"./chunk-x1naayst.js";import"./chunk-ng85b73s.js";import"./chunk-k5vwx1nv.js";import"./chunk-ej3gmaba.js";import"./chunk-3nc9wy1m.js";import"./chunk-r8ddb02d.js";import"./chunk-dhvwrrqx.js";import"./chunk-56cty7nr.js";import"./chunk-thbjhgw0.js";import"./chunk-v7yvnnmr.js";import"./chunk-b5x3zghc.js";import"./chunk-t1f7jeat.js";import"./chunk-tk6gjy9d.js";import"./chunk-pkdk0ppc.js";import"./chunk-hrnx60em.js";import"./chunk-bbznk59q.js";import"./chunk-01gtn79f.js";import"./chunk-meaa7wrs.js";import"./chunk-gvj8qg7x.js";import"./chunk-fa03gsff.js";export{a as tui};