@qitqode/qitqode-android-arm64 0.2.4 → 0.2.5

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 (74) hide show
  1. package/bundle/{chunk-4v2pzx22.js → chunk-03bp59wq.js} +1 -1
  2. package/bundle/{chunk-x65xbskr.js → chunk-0g7acwt1.js} +1 -1
  3. package/bundle/{chunk-kp6gh35c.js → chunk-0j5rzaxx.js} +1 -1
  4. package/bundle/{chunk-6v5867cy.js → chunk-13rsd5vv.js} +1 -1
  5. package/bundle/{chunk-cx78hhbx.js → chunk-2b3fn9xv.js} +1 -1
  6. package/bundle/{chunk-k2g8346v.js → chunk-2nv1scj9.js} +1 -1
  7. package/bundle/{chunk-8q38721t.js → chunk-36xm6mgm.js} +1 -1
  8. package/bundle/{chunk-7msfwk15.js → chunk-3akv2xqh.js} +1 -1
  9. package/bundle/{chunk-aj1sgq1d.js → chunk-3cqrz7g1.js} +1 -1
  10. package/bundle/{chunk-1rtx2zsc.js → chunk-41cq88js.js} +1 -1
  11. package/bundle/{chunk-xpjhe9gz.js → chunk-44723rmb.js} +1 -1
  12. package/bundle/{chunk-3hcr2bzt.js → chunk-45k7qm85.js} +1 -1
  13. package/bundle/{chunk-twp3mjj0.js → chunk-52frd9p0.js} +4 -4
  14. package/bundle/{chunk-t2n7vgsq.js → chunk-5gsdnejs.js} +1 -1
  15. package/bundle/{chunk-bghqsh7r.js → chunk-5qsr1q4t.js} +1 -1
  16. package/bundle/{chunk-k2vsezeb.js → chunk-6sxx56b2.js} +1 -1
  17. package/bundle/{chunk-58dpxf8r.js → chunk-6t48g4x5.js} +1 -1
  18. package/bundle/{chunk-a3edstpn.js → chunk-7ayb3k5p.js} +1 -1
  19. package/bundle/{chunk-k6y2vw0d.js → chunk-826r9svy.js} +1 -1
  20. package/bundle/{chunk-58w8c6c2.js → chunk-89b4k585.js} +1 -1
  21. package/bundle/{chunk-thrfabyv.js → chunk-93gdcrbc.js} +1 -1
  22. package/bundle/{chunk-d5qgc18n.js → chunk-98b7ecrk.js} +1 -1
  23. package/bundle/{chunk-7j4qne3q.js → chunk-a9a0cwmf.js} +1 -1
  24. package/bundle/{chunk-b034nf8g.js → chunk-acpjrs02.js} +1 -1
  25. package/bundle/{chunk-6fc3gw3e.js → chunk-af81r4v7.js} +1 -1
  26. package/bundle/{chunk-t6yzrmww.js → chunk-bbdp6dj4.js} +1 -1
  27. package/bundle/{chunk-9pmmf4k1.js → chunk-bch1rj72.js} +1 -1
  28. package/bundle/{chunk-grnjm8ev.js → chunk-c55f729m.js} +1 -1
  29. package/bundle/{chunk-rv08wm9j.js → chunk-cfjjx3sh.js} +1 -1
  30. package/bundle/{chunk-2prf30p3.js → chunk-cq9sd32h.js} +1 -1
  31. package/bundle/{chunk-cdja76vj.js → chunk-ct693qsd.js} +1 -1
  32. package/bundle/{chunk-qnaw8k98.js → chunk-dt5aae7t.js} +1 -1
  33. package/bundle/{chunk-pdjafjry.js → chunk-eb4y8bjv.js} +1 -1
  34. package/bundle/{chunk-v3arcn10.js → chunk-fxx0z4yb.js} +1 -1
  35. package/bundle/{chunk-9y03z65a.js → chunk-g3y5xemb.js} +1 -1
  36. package/bundle/{chunk-ak8e1nrf.js → chunk-h5pnng66.js} +1 -1
  37. package/bundle/{chunk-g26tersc.js → chunk-hgmqz75r.js} +1 -1
  38. package/bundle/{chunk-qk9x8j8d.js → chunk-jxwey5py.js} +1 -1
  39. package/bundle/{chunk-kqhczjf6.js → chunk-jyt2xvha.js} +1 -1
  40. package/bundle/{chunk-j4ad3mde.js → chunk-kdj7xvz7.js} +1 -1
  41. package/bundle/{chunk-dypdyrmy.js → chunk-kf2f3mza.js} +1 -1
  42. package/bundle/{chunk-09geev0j.js → chunk-kj8cmn7z.js} +1 -1
  43. package/bundle/{chunk-ab4dq1bn.js → chunk-kn8w69g9.js} +1 -1
  44. package/bundle/{chunk-x749e61j.js → chunk-kxwkab31.js} +1 -1
  45. package/bundle/{chunk-dj1jen1p.js → chunk-m7v4ky0y.js} +1 -1
  46. package/bundle/{chunk-2mm37s1w.js → chunk-mtpzcc14.js} +1 -1
  47. package/bundle/{chunk-620dpezx.js → chunk-np12r26m.js} +1 -1
  48. package/bundle/{chunk-snqa3zsm.js → chunk-nw3e93y8.js} +1 -1
  49. package/bundle/{chunk-25ganjcn.js → chunk-nymf08b4.js} +2 -2
  50. package/bundle/{chunk-1t0c86bz.js → chunk-pxv12ctq.js} +1 -1
  51. package/bundle/{chunk-jdx3jshm.js → chunk-r1xh50b2.js} +1 -1
  52. package/bundle/{chunk-xv5z1bj6.js → chunk-rn043d0r.js} +1 -1
  53. package/bundle/chunk-rrd0fdra.js +2 -0
  54. package/bundle/{chunk-jebss7x8.js → chunk-sf5zc4kc.js} +1 -1
  55. package/bundle/{chunk-w88ve2pm.js → chunk-t5xxs5kp.js} +1 -1
  56. package/bundle/{chunk-j8nkz81m.js → chunk-t9pwz4ws.js} +1 -1
  57. package/bundle/{chunk-ytetprwr.js → chunk-ty2vg1a5.js} +1 -1
  58. package/bundle/{chunk-r6p0bd2w.js → chunk-v3nqkqhz.js} +201 -199
  59. package/bundle/{chunk-ckb1y6gv.js → chunk-vp9scf28.js} +1 -1
  60. package/bundle/{chunk-hz3h6e19.js → chunk-vwh6mv37.js} +1 -1
  61. package/bundle/{chunk-ztn9e8g1.js → chunk-w2cb8cry.js} +1 -1
  62. package/bundle/{chunk-hg4039nz.js → chunk-wmezdcdh.js} +2 -2
  63. package/bundle/{chunk-b2p54yka.js → chunk-xhtcegk0.js} +1 -1
  64. package/bundle/{chunk-7zx1ve4w.js → chunk-xmb8jy13.js} +1 -1
  65. package/bundle/{chunk-6pe60dsw.js → chunk-xqnzmr7a.js} +1 -1
  66. package/bundle/{chunk-jqekpprn.js → chunk-xy3c8f1h.js} +1 -1
  67. package/bundle/{chunk-ym09zrxe.js → chunk-xynwfaf1.js} +1 -1
  68. package/bundle/{chunk-3zrr4n6k.js → chunk-yfzyzsr4.js} +1 -1
  69. package/bundle/{chunk-zzznad30.js → chunk-yv5aehqq.js} +1 -1
  70. package/bundle/{chunk-pkn85169.js → chunk-zgcabs1k.js} +1 -1
  71. package/bundle/index.js +3 -3
  72. package/bundle/worker.js +1 -1
  73. package/package.json +1 -1
  74. package/bundle/chunk-dwhjgd8j.js +0 -2
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{h as _}from"./chunk-t2n7vgsq.js";import{F as W,G as Y,H as G}from"./chunk-cdja76vj.js";import{ae as X}from"./chunk-5w76kdjr.js";import{dg as j}from"./chunk-eg3syjtv.js";import{Eg as O}from"./chunk-8q38721t.js";import{Bh as v}from"./chunk-r6p0bd2w.js";import"./chunk-w46g7kdq.js";import"./chunk-bd21p9zz.js";import"./chunk-p54bzjtv.js";import"./chunk-ha1w0xzh.js";import"./chunk-6m9jb0s9.js";import"./chunk-vygkwwjd.js";import{xj as H}from"./chunk-twp3mjj0.js";import"./chunk-6pe60dsw.js";import"./chunk-jdx3jshm.js";import"./chunk-6v5867cy.js";import"./chunk-mh19kwzw.js";import"./chunk-7j4qne3q.js";import"./chunk-snqa3zsm.js";import"./chunk-9zm6r55d.js";import"./chunk-vcygx6hs.js";import"./chunk-khzzmyk2.js";import"./chunk-y7hgevfv.js";import"./chunk-47k5jy1p.js";import{Bo as F,go as K}from"./chunk-ab4dq1bn.js";import"./chunk-ph8hn1wt.js";import"./chunk-ptqk1j2r.js";import"./chunk-cqtkxwd8.js";import"./chunk-pr7z5dj8.js";import"./chunk-dnnkq5y4.js";import"./chunk-t239rvej.js";import"./chunk-yz25607t.js";import"./chunk-7hvf9dgx.js";import"./chunk-wkg3c643.js";import"./chunk-fhqfqd5v.js";import"./chunk-cx78hhbx.js";import"./chunk-xv5z1bj6.js";import"./chunk-73r8bjjz.js";import"./chunk-w88ve2pm.js";import"./chunk-ztyy3ga3.js";import"./chunk-mmjgf680.js";import"./chunk-nj1ntakd.js";import"./chunk-cmb62jkt.js";import"./chunk-tkrwcjkr.js";import"./chunk-ztn9e8g1.js";import"./chunk-09geev0j.js";import"./chunk-r5zy4za0.js";import"./chunk-tr6rdr6h.js";import"./chunk-at22twxx.js";import"./chunk-kgptyf7n.js";import"./chunk-j9h1sp4g.js";import"./chunk-p6crzjtf.js";import"./chunk-55fcmswd.js";import{eH as z}from"./chunk-qnvsqnz5.js";import"./chunk-pxm4qvqk.js";import"./chunk-j8fcfhr2.js";import"./chunk-r9w0thdk.js";var Q="forgewise";function R(D){return z.gen(function*(){let M=yield*D.get(Q);if(!M||M.type!=="api")return;return(M.metadata??{}).sub})}var w=()=>z.gen(function*(){if((yield*_())==="revoked")return null;let D=yield*z.promise(()=>K());if(!D)return yield*z.sync(()=>j.println(j.Style.TEXT_DANGER+"Not signed in to Forgewise. Run `qitqode auth login` first."+j.Style.TEXT_NORMAL)),null;let M=yield*H.Service,T=D.method==="sso"?yield*R(M):void 0;return{key:D.key,method:D.method,sub:T}}),b=()=>z.gen(function*(){let D=yield*w();if(!D)return;let M=yield*z.tryPromise({try:()=>O(D),catch:(P)=>P}).pipe(z.map((P)=>({ok:!0,result:P})),z.catch((P)=>z.succeed({ok:!1,error:P})));if(!M.ok){let P=M.error instanceof F?M.error.message:"Could not fetch balance.";yield*z.sync(()=>j.println(j.Style.TEXT_DANGER+P+j.Style.TEXT_NORMAL));return}let T=M.result;if(!T){yield*z.sync(()=>j.println(j.Style.TEXT_DANGER+"Could not fetch balance."+j.Style.TEXT_NORMAL));return}yield*z.sync(()=>j.println(j.Style.TEXT_SUCCESS+"Qredits balance: "+j.Style.TEXT_NORMAL+j.Style.TEXT_HIGHLIGHT_BOLD+G(T.balance)+j.Style.TEXT_NORMAL))}).pipe(z.withSpan("qredits.balance")),q=()=>z.gen(function*(){let D=yield*w();if(!D)return;let M=D.method==="sso"&&D.sub?{userId:D.sub,accessToken:D.key}:{},T=yield*z.tryPromise({try:()=>Y({...M,limit:20}),catch:(J)=>J}).pipe(z.map((J)=>({ok:!0,result:J})),z.catch((J)=>z.succeed({ok:!1,error:J})));if(!T.ok){let J=T.error,$=J instanceof F?J.message+"\nPer-session spend is available with `qitqode usage`.":J instanceof W?J.message:String(J);yield*z.sync(()=>j.println(j.Style.TEXT_DANGER+"Could not fetch history: "+$+j.Style.TEXT_NORMAL));return}let P=T.result;if(P.length===0){yield*z.sync(()=>j.println("No spend history yet."));return}let Z=j.Style.TEXT_DIM,V=j.Style.TEXT_NORMAL,x=j.Style.TEXT_DANGER;yield*z.sync(()=>{j.println(Z+" Date Description Amount"+V),j.println(Z+" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500"+V);for(let J of P){let $=(J.date||"").slice(0,10).padEnd(18),L=(J.description||"").slice(0,32).padEnd(32),N=(J.amount<0?"-":" ")+G(Math.abs(J.amount)),B=J.amount<0?x:V;j.println(` ${Z}${$}${V} ${L} ${B}${N}${V}`)}})}).pipe(z.withSpan("qredits.history")),m=X({command:"qredits <command>",describe:"Check Qredits balance and spend history",builder:(D)=>D.command(X({command:"balance",describe:"Show current Qredits balance",builder:(M)=>M,async handler(){j.empty(),await v.runPromise(b())}})).command(X({command:"history",describe:"Show recent Qredit spend history",builder:(M)=>M,async handler(){j.empty(),await v.runPromise(q())}})).demandCommand(),async handler(){}});export{q as historyEffect,b as balanceEffect,m as QreditsCommand};
2
+ import{h as _}from"./chunk-5gsdnejs.js";import{F as W,G as Y,H as G}from"./chunk-ct693qsd.js";import{ae as X}from"./chunk-5w76kdjr.js";import{dg as j}from"./chunk-eg3syjtv.js";import{Eg as O}from"./chunk-36xm6mgm.js";import{Bh as v}from"./chunk-v3nqkqhz.js";import"./chunk-w46g7kdq.js";import"./chunk-bd21p9zz.js";import"./chunk-p54bzjtv.js";import"./chunk-ha1w0xzh.js";import"./chunk-6m9jb0s9.js";import"./chunk-vygkwwjd.js";import{xj as H}from"./chunk-52frd9p0.js";import"./chunk-xqnzmr7a.js";import"./chunk-r1xh50b2.js";import"./chunk-13rsd5vv.js";import"./chunk-mh19kwzw.js";import"./chunk-a9a0cwmf.js";import"./chunk-nw3e93y8.js";import"./chunk-9zm6r55d.js";import"./chunk-vcygx6hs.js";import"./chunk-khzzmyk2.js";import"./chunk-y7hgevfv.js";import"./chunk-47k5jy1p.js";import{Bo as F,go as K}from"./chunk-kn8w69g9.js";import"./chunk-ph8hn1wt.js";import"./chunk-ptqk1j2r.js";import"./chunk-cqtkxwd8.js";import"./chunk-pr7z5dj8.js";import"./chunk-dnnkq5y4.js";import"./chunk-t239rvej.js";import"./chunk-yz25607t.js";import"./chunk-7hvf9dgx.js";import"./chunk-wkg3c643.js";import"./chunk-fhqfqd5v.js";import"./chunk-2b3fn9xv.js";import"./chunk-rn043d0r.js";import"./chunk-73r8bjjz.js";import"./chunk-t5xxs5kp.js";import"./chunk-ztyy3ga3.js";import"./chunk-mmjgf680.js";import"./chunk-nj1ntakd.js";import"./chunk-cmb62jkt.js";import"./chunk-tkrwcjkr.js";import"./chunk-w2cb8cry.js";import"./chunk-kj8cmn7z.js";import"./chunk-r5zy4za0.js";import"./chunk-tr6rdr6h.js";import"./chunk-at22twxx.js";import"./chunk-kgptyf7n.js";import"./chunk-j9h1sp4g.js";import"./chunk-p6crzjtf.js";import"./chunk-55fcmswd.js";import{eH as z}from"./chunk-qnvsqnz5.js";import"./chunk-pxm4qvqk.js";import"./chunk-j8fcfhr2.js";import"./chunk-r9w0thdk.js";var Q="forgewise";function R(D){return z.gen(function*(){let M=yield*D.get(Q);if(!M||M.type!=="api")return;return(M.metadata??{}).sub})}var w=()=>z.gen(function*(){if((yield*_())==="revoked")return null;let D=yield*z.promise(()=>K());if(!D)return yield*z.sync(()=>j.println(j.Style.TEXT_DANGER+"Not signed in to Forgewise. Run `qitqode auth login` first."+j.Style.TEXT_NORMAL)),null;let M=yield*H.Service,T=D.method==="sso"?yield*R(M):void 0;return{key:D.key,method:D.method,sub:T}}),b=()=>z.gen(function*(){let D=yield*w();if(!D)return;let M=yield*z.tryPromise({try:()=>O(D),catch:(P)=>P}).pipe(z.map((P)=>({ok:!0,result:P})),z.catch((P)=>z.succeed({ok:!1,error:P})));if(!M.ok){let P=M.error instanceof F?M.error.message:"Could not fetch balance.";yield*z.sync(()=>j.println(j.Style.TEXT_DANGER+P+j.Style.TEXT_NORMAL));return}let T=M.result;if(!T){yield*z.sync(()=>j.println(j.Style.TEXT_DANGER+"Could not fetch balance."+j.Style.TEXT_NORMAL));return}yield*z.sync(()=>j.println(j.Style.TEXT_SUCCESS+"Qredits balance: "+j.Style.TEXT_NORMAL+j.Style.TEXT_HIGHLIGHT_BOLD+G(T.balance)+j.Style.TEXT_NORMAL))}).pipe(z.withSpan("qredits.balance")),q=()=>z.gen(function*(){let D=yield*w();if(!D)return;let M=D.method==="sso"&&D.sub?{userId:D.sub,accessToken:D.key}:{},T=yield*z.tryPromise({try:()=>Y({...M,limit:20}),catch:(J)=>J}).pipe(z.map((J)=>({ok:!0,result:J})),z.catch((J)=>z.succeed({ok:!1,error:J})));if(!T.ok){let J=T.error,$=J instanceof F?J.message+"\nPer-session spend is available with `qitqode usage`.":J instanceof W?J.message:String(J);yield*z.sync(()=>j.println(j.Style.TEXT_DANGER+"Could not fetch history: "+$+j.Style.TEXT_NORMAL));return}let P=T.result;if(P.length===0){yield*z.sync(()=>j.println("No spend history yet."));return}let Z=j.Style.TEXT_DIM,V=j.Style.TEXT_NORMAL,x=j.Style.TEXT_DANGER;yield*z.sync(()=>{j.println(Z+" Date Description Amount"+V),j.println(Z+" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500"+V);for(let J of P){let $=(J.date||"").slice(0,10).padEnd(18),L=(J.description||"").slice(0,32).padEnd(32),N=(J.amount<0?"-":" ")+G(Math.abs(J.amount)),B=J.amount<0?x:V;j.println(` ${Z}${$}${V} ${L} ${B}${N}${V}`)}})}).pipe(z.withSpan("qredits.history")),m=X({command:"qredits <command>",describe:"Check Qredits balance and spend history",builder:(D)=>D.command(X({command:"balance",describe:"Show current Qredits balance",builder:(M)=>M,async handler(){j.empty(),await v.runPromise(b())}})).command(X({command:"history",describe:"Show recent Qredit spend history",builder:(M)=>M,async handler(){j.empty(),await v.runPromise(q())}})).demandCommand(),async handler(){}});export{q as historyEffect,b as balanceEffect,m as QreditsCommand};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{p as y,q as T,r as M,s as D,t as U}from"./chunk-6fc3gw3e.js";import{Td as X,Ud as _,Vd as $,Yd as v}from"./chunk-ff548b0j.js";import"./chunk-zc0cdvcv.js";import{ae as j}from"./chunk-5w76kdjr.js";import{dg as V}from"./chunk-eg3syjtv.js";import{Nl as J}from"./chunk-jdx3jshm.js";import"./chunk-6v5867cy.js";import"./chunk-mh19kwzw.js";import{jn as F,xn as G}from"./chunk-snqa3zsm.js";import"./chunk-9zm6r55d.js";import"./chunk-vcygx6hs.js";import"./chunk-khzzmyk2.js";import"./chunk-y7hgevfv.js";import"./chunk-cx78hhbx.js";import"./chunk-xv5z1bj6.js";import"./chunk-73r8bjjz.js";import"./chunk-w88ve2pm.js";import"./chunk-ztyy3ga3.js";import"./chunk-mmjgf680.js";import"./chunk-nj1ntakd.js";import"./chunk-cmb62jkt.js";import"./chunk-tkrwcjkr.js";import"./chunk-09geev0j.js";import{Hs as Z}from"./chunk-r5zy4za0.js";import"./chunk-tr6rdr6h.js";import{kt as E}from"./chunk-at22twxx.js";import"./chunk-kgptyf7n.js";import"./chunk-j9h1sp4g.js";import"./chunk-p6crzjtf.js";import"./chunk-55fcmswd.js";import"./chunk-qnvsqnz5.js";import"./chunk-r9w0thdk.js";import h from"path";var b={spinner:()=>v(),log:{error:(w)=>X.error(w),info:(w)=>X.info(w),success:(w)=>X.success(w)},resolve:(w)=>G(w),...T,global:E.Path.config};function P(w){if(!w||typeof w!=="object")return;if(!("cause"in w))return;return w.cause}function I(w,q=b){let H=w.mod,K=Boolean(w.force),W=Boolean(w.global);return async(O)=>{let R=q.spinner();R.start("Installing plugin package...");let S=await M(H,q);if(!S.ok){R.stop("Install failed",1),q.log.error(`Could not install "${H}"`);let B=y(S.error);if(B.detail)q.log.error(B.detail);if(B.missing)q.log.info("This package depends on a version that is not available in your npm registry."),q.log.info("Check npm registry/auth settings and try again.");return!1}R.stop("Plugin package ready");let L=q.spinner();L.start("Reading plugin manifest...");let z=await D(S.target);if(!z.ok){if(z.code==="manifest_read_failed")return L.stop("Manifest read failed",1),q.log.error(`Installed "${H}" but failed to read ${z.file}`),q.log.error(Z(P(z.error)??z.error)),!1;if(z.code==="manifest_no_targets")return L.stop("No plugin targets found",1),q.log.error(`"${H}" does not expose plugin entrypoints in package.json`),q.log.info('Expected one of: exports["./tui"], exports["./server"], package.json main for server, or package.json["oc-themes"] for tui themes.'),!1;return L.stop("Manifest read failed",1),!1}L.stop(`Detected ${z.targets.map((B)=>B.kind).join(" + ")} target${z.targets.length===1?"":"s"}`);let N=q.spinner();N.start("Updating plugin config...");let A=await U({spec:H,targets:z.targets,force:K,global:W,vcs:O.vcs,worktree:O.worktree,directory:O.directory,config:q.global},q);if(!A.ok){if(A.code==="invalid_json")return N.stop(`Failed updating ${A.kind} config`,1),q.log.error(`Invalid JSON in ${A.file} (${A.parse} at line ${A.line}, column ${A.col})`),q.log.info("Fix the config file and run the command again."),!1;return N.stop("Failed updating plugin config",1),q.log.error(Z(A.error)),!1}N.stop("Plugin config updated");for(let B of A.items){if(B.mode==="noop"){q.log.info(`Already configured in ${B.file}`);continue}if(B.mode==="replace"){q.log.info(`Replaced in ${B.file}`);continue}q.log.info(`Added to ${B.file}`)}return q.log.success(`Installed ${H}`),q.log.info(W?`Scope: global (${A.dir})`:`Scope: local (${A.dir})`),!0}}async function x(w,q=b,H=(K)=>V.println(K)){let K=w.vcs==="git"&&w.worktree!=="/",W=[{scope:"local",dir:h.join(K?w.worktree:w.directory,".qitqode")},{scope:"global",dir:q.global}],O=0;for(let{scope:R,dir:S}of W)for(let L of["qitqode","tui"])for(let z of q.files(S,L)){if(!await q.exists(z))continue;let N=await q.readText(z).catch(()=>{return});if(N===void 0)continue;let A=[],B=F(N,A,{allowTrailingComma:!0});if(A.length){q.log.error(`Invalid JSON in ${z} \u2014 skipped`);continue}let Y=B?.plugin;if(!Array.isArray(Y)||Y.length===0)continue;q.log.info(`${R} \xB7 ${z}`);for(let Q of Y){let C=typeof Q==="string"?Q:Array.isArray(Q)?String(Q[0]):void 0;if(!C)continue;let k=Array.isArray(Q)&&Q[1]?" (with options)":"";H(" "+C+k),O++}}if(O===0)q.log.info("No plugins configured.")}var i=j({command:"plugin <module>",aliases:["plug"],describe:"install plugin and update config",builder:(w)=>{return w.positional("module",{type:"string",describe:"npm module name"}).option("global",{alias:["g"],type:"boolean",default:!1,describe:"install in global config"}).option("force",{alias:["f"],type:"boolean",default:!1,describe:"replace existing plugin version"})},handler:async(w)=>{let q=String(w.module??"").trim();if(!q){V.error("module is required"),process.exitCode=1;return}if(q==="list"){V.empty(),_("Configured plugins"),await J.provide({directory:process.cwd(),fn:async()=>{await x({vcs:J.project.vcs,worktree:J.worktree,directory:J.directory})}}),$("Done");return}V.empty(),_(`Install plugin ${q}`);let H=I({mod:q,global:Boolean(w.global),force:Boolean(w.force)}),K=!0;if(await J.provide({directory:process.cwd(),fn:async()=>{K=await H({vcs:J.project.vcs,worktree:J.worktree,directory:J.directory})}}),$("Done"),!K)process.exitCode=1}});export{x as listPlugins,I as createPlugTask,i as PluginCommand};
2
+ import{p as y,q as T,r as M,s as D,t as U}from"./chunk-af81r4v7.js";import{Td as X,Ud as _,Vd as $,Yd as v}from"./chunk-ff548b0j.js";import"./chunk-zc0cdvcv.js";import{ae as j}from"./chunk-5w76kdjr.js";import{dg as V}from"./chunk-eg3syjtv.js";import{Nl as J}from"./chunk-r1xh50b2.js";import"./chunk-13rsd5vv.js";import"./chunk-mh19kwzw.js";import{jn as F,xn as G}from"./chunk-nw3e93y8.js";import"./chunk-9zm6r55d.js";import"./chunk-vcygx6hs.js";import"./chunk-khzzmyk2.js";import"./chunk-y7hgevfv.js";import"./chunk-2b3fn9xv.js";import"./chunk-rn043d0r.js";import"./chunk-73r8bjjz.js";import"./chunk-t5xxs5kp.js";import"./chunk-ztyy3ga3.js";import"./chunk-mmjgf680.js";import"./chunk-nj1ntakd.js";import"./chunk-cmb62jkt.js";import"./chunk-tkrwcjkr.js";import"./chunk-kj8cmn7z.js";import{Hs as Z}from"./chunk-r5zy4za0.js";import"./chunk-tr6rdr6h.js";import{kt as E}from"./chunk-at22twxx.js";import"./chunk-kgptyf7n.js";import"./chunk-j9h1sp4g.js";import"./chunk-p6crzjtf.js";import"./chunk-55fcmswd.js";import"./chunk-qnvsqnz5.js";import"./chunk-r9w0thdk.js";import h from"path";var b={spinner:()=>v(),log:{error:(w)=>X.error(w),info:(w)=>X.info(w),success:(w)=>X.success(w)},resolve:(w)=>G(w),...T,global:E.Path.config};function P(w){if(!w||typeof w!=="object")return;if(!("cause"in w))return;return w.cause}function I(w,q=b){let H=w.mod,K=Boolean(w.force),W=Boolean(w.global);return async(O)=>{let R=q.spinner();R.start("Installing plugin package...");let S=await M(H,q);if(!S.ok){R.stop("Install failed",1),q.log.error(`Could not install "${H}"`);let B=y(S.error);if(B.detail)q.log.error(B.detail);if(B.missing)q.log.info("This package depends on a version that is not available in your npm registry."),q.log.info("Check npm registry/auth settings and try again.");return!1}R.stop("Plugin package ready");let L=q.spinner();L.start("Reading plugin manifest...");let z=await D(S.target);if(!z.ok){if(z.code==="manifest_read_failed")return L.stop("Manifest read failed",1),q.log.error(`Installed "${H}" but failed to read ${z.file}`),q.log.error(Z(P(z.error)??z.error)),!1;if(z.code==="manifest_no_targets")return L.stop("No plugin targets found",1),q.log.error(`"${H}" does not expose plugin entrypoints in package.json`),q.log.info('Expected one of: exports["./tui"], exports["./server"], package.json main for server, or package.json["oc-themes"] for tui themes.'),!1;return L.stop("Manifest read failed",1),!1}L.stop(`Detected ${z.targets.map((B)=>B.kind).join(" + ")} target${z.targets.length===1?"":"s"}`);let N=q.spinner();N.start("Updating plugin config...");let A=await U({spec:H,targets:z.targets,force:K,global:W,vcs:O.vcs,worktree:O.worktree,directory:O.directory,config:q.global},q);if(!A.ok){if(A.code==="invalid_json")return N.stop(`Failed updating ${A.kind} config`,1),q.log.error(`Invalid JSON in ${A.file} (${A.parse} at line ${A.line}, column ${A.col})`),q.log.info("Fix the config file and run the command again."),!1;return N.stop("Failed updating plugin config",1),q.log.error(Z(A.error)),!1}N.stop("Plugin config updated");for(let B of A.items){if(B.mode==="noop"){q.log.info(`Already configured in ${B.file}`);continue}if(B.mode==="replace"){q.log.info(`Replaced in ${B.file}`);continue}q.log.info(`Added to ${B.file}`)}return q.log.success(`Installed ${H}`),q.log.info(W?`Scope: global (${A.dir})`:`Scope: local (${A.dir})`),!0}}async function x(w,q=b,H=(K)=>V.println(K)){let K=w.vcs==="git"&&w.worktree!=="/",W=[{scope:"local",dir:h.join(K?w.worktree:w.directory,".qitqode")},{scope:"global",dir:q.global}],O=0;for(let{scope:R,dir:S}of W)for(let L of["qitqode","tui"])for(let z of q.files(S,L)){if(!await q.exists(z))continue;let N=await q.readText(z).catch(()=>{return});if(N===void 0)continue;let A=[],B=F(N,A,{allowTrailingComma:!0});if(A.length){q.log.error(`Invalid JSON in ${z} \u2014 skipped`);continue}let Y=B?.plugin;if(!Array.isArray(Y)||Y.length===0)continue;q.log.info(`${R} \xB7 ${z}`);for(let Q of Y){let C=typeof Q==="string"?Q:Array.isArray(Q)?String(Q[0]):void 0;if(!C)continue;let k=Array.isArray(Q)&&Q[1]?" (with options)":"";H(" "+C+k),O++}}if(O===0)q.log.info("No plugins configured.")}var i=j({command:"plugin <module>",aliases:["plug"],describe:"install plugin and update config",builder:(w)=>{return w.positional("module",{type:"string",describe:"npm module name"}).option("global",{alias:["g"],type:"boolean",default:!1,describe:"install in global config"}).option("force",{alias:["f"],type:"boolean",default:!1,describe:"replace existing plugin version"})},handler:async(w)=>{let q=String(w.module??"").trim();if(!q){V.error("module is required"),process.exitCode=1;return}if(q==="list"){V.empty(),_("Configured plugins"),await J.provide({directory:process.cwd(),fn:async()=>{await x({vcs:J.project.vcs,worktree:J.worktree,directory:J.directory})}}),$("Done");return}V.empty(),_(`Install plugin ${q}`);let H=I({mod:q,global:Boolean(w.global),force:Boolean(w.force)}),K=!0;if(await J.provide({directory:process.cwd(),fn:async()=>{K=await H({vcs:J.project.vcs,worktree:J.worktree,directory:J.directory})}}),$("Done"),!K)process.exitCode=1}});export{x as listPlugins,I as createPlugTask,i as PluginCommand};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{Tl as f,Ul as Gj,Vl as Rj,Wl as Hj,Zl as s}from"./chunk-6v5867cy.js";import{Jn as xj}from"./chunk-9zm6r55d.js";import{Pn as vj}from"./chunk-khzzmyk2.js";import{$q as Kj,Tq as P,Uq as wj,_q as k}from"./chunk-73r8bjjz.js";import{ds as a,es as y}from"./chunk-09geev0j.js";import{Ns as I,Ws as h}from"./chunk-tr6rdr6h.js";import{ft as i,gt as Ij,ht as Jj,kt as Nj}from"./chunk-at22twxx.js";import{lt as j}from"./chunk-kgptyf7n.js";import{DE as o,TN as C,XJ as l,YE as d,eH as Q,zB as Wj}from"./chunk-qnvsqnz5.js";import{sO as Mj,uO as Oj,wO as Ej}from"./chunk-r9w0thdk.js";var tj={};Oj(tj,{stopRefresh:()=>aj,startRefresh:()=>sj,refresh:()=>jj,readModelCatalogResponse:()=>Pj,get:()=>fj,Provider:()=>cj,Model:()=>pj,MODEL_CATALOG_MAX_BYTES:()=>Aj,Data:()=>S});import hj from"path";var U={};Oj(U,{layer:()=>Bj,isPreview:()=>ij,isNewerVersion:()=>qj,isLocal:()=>mj,getReleaseType:()=>yj,defaultLayer:()=>uj,UpgradeFailedError:()=>x,USER_AGENT:()=>Sj,Service:()=>E,Installation:()=>U,Info:()=>Uj,Event:()=>Cj});var _j=(J)=>J.pipe(k.retryTransient({retryOn:"errors-and-responses",times:2,schedule:d.exponential(200).pipe(d.jittered)}));import Yj from"path";var z=Mj(xj(),1);import n from"crypto";import v from"fs";import Zj from"path";class H extends Error{constructor(J){super(J);this.name="SelfUpdateError"}}function $j(J){let V=J?.platform??process.platform,_=J?.arch??process.arch,$=J?.libc??"bionic",W=["qitqode",V==="win32"?"windows":V,_];if(_==="x64")W.push("baseline");if(V==="linux"&&$==="musl")W.push("musl");return`@qitqode/${W.join("-")}`}function kj(J,V){if(V.integrity){let _=V.integrity.match(/^(sha512|sha384|sha256)-([A-Za-z0-9+/=]+)$/);if(!_)throw new H(`registry returned an unrecognized integrity string: ${V.integrity}`);if(n.createHash(_[1]).update(J).digest("base64")!==_[2])throw new H(`checksum mismatch: downloaded tarball does not match the registry ${_[1]} integrity value; refusing to install`);return}if(V.shasum){if(n.createHash("sha1").update(J).digest("hex")!==V.shasum.toLowerCase())throw new H("checksum mismatch: downloaded tarball does not match the registry shasum; refusing to install");return}throw new H("registry provided no integrity metadata for the tarball; refusing to install")}function Qj(J,V){let _=(w,R)=>{let G=w,q=w+R;while(G<q&&J[G]!==0)G++;return new TextDecoder().decode(J.subarray(w,G))},$=0,W;while($+512<=J.length){if(J.subarray($,$+512).every((Z)=>Z===0))break;let R=_($+124,12).trim(),G=R?parseInt(R,8):0;if(!Number.isFinite(G)||G<0)throw new H("downloaded tarball is corrupt (bad tar header)");let q=String.fromCharCode(J[$+156]),B=_($,100),N=_($+345,155);if(N)B=`${N}/${B}`;if(W)B=W,W=void 0;let b=$+512,X=b+G;if(q==="L")W=new TextDecoder().decode(J.subarray(b,X)).replace(/\0+$/,"");else if((q==="0"||q==="\x00"||q==="")&&B===V)return J.slice(b,X);$=b+Math.ceil(G/512)*512}return}var A=(J)=>String(J instanceof Error?J.message:J),u=(J)=>Q.fail(new H(J)),p=(J,V)=>Q.try({try:J,catch:(_)=>new H(V(_))}),Xj=Q.fnUntraced(function*(J){let{target:V,execPath:_,packageName:$,registry:W}=J,w=J.gunzip??((K)=>Bun.gunzipSync(K)),R=Zj.dirname(_);yield*p(()=>v.accessSync(R,v.constants.W_OK),()=>`no write permission for ${R}; cannot replace ${_}. Fix the directory permissions or re-run with sufficient privileges.`);let G=`${W}/${$}/${encodeURIComponent(V)}`,B=(yield*J.fetchJson(G).pipe(Q.mapError((K)=>new H(`download failed: could not fetch ${$}@${V} from ${W} (${A(K)}). Check your network connection and that version ${V} exists.`))))?.dist;if(!B?.tarball)return yield*u(`registry response for ${$}@${V} has no tarball URL; cannot self-update`);let N=B.tarball,b=yield*J.fetchBytes(N).pipe(Q.mapError((K)=>new H(`download failed: could not download ${N} (${A(K)}). Check your network connection and try again.`)));yield*Q.try({try:()=>kj(b,B),catch:(K)=>K instanceof H?K:new H(A(K))});let X=yield*Q.try({try:()=>w(b),catch:()=>new H("downloaded tarball is corrupt (gunzip failed); try again")}),Z=Qj(X,"package/bin/qitqode")??Qj(X,"package/bin/qitqode.exe");if(!Z||Z.length===0)return yield*u(`tarball for ${$}@${V} does not contain the expected binary at bin/qitqode`);let O=Zj.join(R,`.qitqode-upgrade-${process.pid}`),Y=`${_}.backup-${process.pid}`,D=(K)=>{try{v.rmSync(K,{force:!0})}catch{}};yield*p(()=>v.writeFileSync(O,Z,{mode:493}),(K)=>{return D(O),`no write permission: could not write ${O} (${A(K)})`});let L=yield*J.runVersion(O).pipe(Q.mapError((K)=>{return D(O),new H(`downloaded binary failed its --version check (${A(K)}); keeping the current installation`)}));if(L.code!==0)return D(O),yield*u(`downloaded binary failed its --version check (exit ${L.code}); keeping the current installation`);let m=L.stdout.trim();if(m&&!m.includes(V))return D(O),yield*u(`downloaded binary reports version "${m}" instead of ${V}; keeping the current installation`);yield*p(()=>v.renameSync(_,Y),(K)=>{return D(O),`could not move the current binary aside (${A(K)}); check permissions on ${_}`}),yield*Q.try({try:()=>v.renameSync(O,_),catch:(K)=>{try{v.renameSync(Y,_)}catch{return new H(`failed to install the new binary AND failed to restore the old one; your previous binary is preserved at ${Y} \u2014 move it back to ${_} manually`)}return D(O),new H(`could not install the new binary (${A(K)}); the previous version was restored`)}}),D(Y)});var c=h.create({service:"installation"}),M="@qitqode/cli";function qj(J,V){if(!z.default.valid(J)||!z.default.valid(V))return!1;return z.default.gt(V,J)}var Cj={Updated:s.define("installation.updated",j.object({version:j.string()})),UpdateAvailable:s.define("installation.update-available",j.object({version:j.string()}))};function yj(J,V){if(!qj(J,V))throw Error(`Version ${V} is not newer than ${J}`);let _=z.default.major(J),$=z.default.minor(J),W=z.default.major(V),w=z.default.minor(V);if(W>_)return"major";if(w>$)return"minor";return"patch"}var Uj=j.object({version:j.string(),latest:j.string()}).meta({ref:"InstallationInfo"}),Sj=`qitqode/${y}/${a}/${I.QITQODE_CLIENT}`;function ij(){return y!=="latest"}function mj(){return y==="local"}class x extends C.TaggedErrorClass()("UpgradeFailedError",{stderr:C.String}){}var nj=C.Struct({version:C.String});class E extends Wj.Service()("@qitqode/Installation"){}var Bj=o.effect(E,Q.gen(function*(){let J=yield*k.HttpClient,V=k.filterStatusOk(_j(J)),_=yield*f.ChildProcessSpawner,$=(X,Z)=>Gj.make(X[0],X.slice(1),{cwd:Z?.cwd,env:Z?.env,extendEnv:!0}),W=Q.fnUntraced(function*(X){let Z=yield*Hj(_,X);return{code:Z.code,stdout:Z.text,stderr:Z.stderr}},Q.scoped),w=Q.fnUntraced(function*(X,Z){let O=yield*_.spawn($(X,Z)),Y=yield*l.mkString(l.decodeText(O.stdout));return yield*O.exitCode,Y},Q.scoped,Q.catch(()=>Q.succeed(""))),R=Q.fnUntraced(function*(X,Z){return yield*W($(X,Z))},Q.catch(()=>Q.succeed({code:f.ExitCode(1),stdout:"",stderr:""}))),G=Q.fn("Installation.method")(function*(){if(process.execPath.includes(Yj.join(".qitqode","bin")))return"curl";if(process.execPath.includes(Yj.join(".local","bin")))return"curl";let X=process.execPath.toLowerCase(),Z=[{name:"npm",command:()=>w(["npm","list","-g","--depth=0"])},{name:"pnpm",command:()=>w(["pnpm","list","-g","--depth=0"])},{name:"bun",command:()=>w(["bun","pm","ls","-g"])}];Z.sort((O,Y)=>{let D=X.includes(O.name),L=X.includes(Y.name);if(D&&!L)return-1;if(!D&&L)return 1;return 0});for(let O of Z)if((yield*O.command()).includes(M))return O.name;return"unknown"}),q=Q.fn("Installation.latest")(function*(X){let Z=X||(yield*G());if(Z==="curl"){let Y=(yield*w(["curl","-sI","https://github.com/qitqode/qitqode/releases/latest"])).match(/^location:.*\/tag\/v([0-9][^\s/]*)/im);if(Y)return Y[1];return yield*Q.die(Error("failed to resolve latest version from GitHub releases redirect"))}if(Z==="npm"||Z==="bun"||Z==="pnpm"){let Y=(yield*w(["npm","config","get","registry"])).trim()||"https://registry.npmjs.org",D=Y.endsWith("/")?Y.slice(0,-1):Y,L=yield*V.execute(P.get(`${D}/${encodeURIComponent(M)}/${y}`).pipe(P.acceptJson));return(yield*wj.schemaBodyJson(nj)(L)).version}return c.warn("unsupported update channel, skipping",{method:Z}),yield*Q.die(Error(`unsupported update channel: ${Z}`))},Q.orDie),B=Q.fnUntraced(function*(){let Z=(yield*w(["npm","config","get","registry"])).trim()||"https://registry.npmjs.org";return Z.endsWith("/")?Z.slice(0,-1):Z}),N=Q.fnUntraced(function*(X){let Z=yield*B();yield*Xj({target:X,execPath:process.env.QITQODE_SELF_UPDATE_TARGET_BINARY||process.execPath,packageName:$j(),registry:Z,fetchJson:(O)=>V.execute(P.get(O).pipe(P.acceptJson)).pipe(Q.flatMap((Y)=>Y.json)),fetchBytes:(O)=>V.execute(P.get(O)).pipe(Q.flatMap((Y)=>Y.arrayBuffer),Q.map((Y)=>new Uint8Array(Y))),runVersion:(O)=>R([O,"--version"]).pipe(Q.map((Y)=>({code:Y.code,stdout:Y.stdout})))}).pipe(Q.mapError((O)=>new x({stderr:O.message})))}),b=Q.fn("Installation.upgrade")(function*(X,Z){if(X==="curl"){yield*N(Z),c.info("upgraded",{method:X,target:Z});return}let Y=yield*(()=>{if(X==="npm")return R(["npm","install","-g",`${M}@${Z}`]);if(X==="pnpm")return R(["pnpm","install","-g",`${M}@${Z}`]);if(X==="bun")return R(["bun","install","-g",`${M}@${Z}`]);return new x({stderr:`Unknown method: ${X}`})})();if(Y.code!==0){let D=Y.stderr||"";return yield*new x({stderr:D})}c.info("upgraded",{method:X,target:Z,stdout:Y.stdout,stderr:Y.stderr}),yield*w([process.execPath,"--version"])});return E.of({info:Q.fn("Installation.info")(function*(){return{version:a,latest:yield*q()}}),method:G,latest:q,upgrade:b})})),uj=Bj.pipe(o.provide(Kj.layer),o.provide(Rj));var t=j.lazy(()=>j.union([j.string(),j.number(),j.boolean(),j.null(),j.array(t),j.record(j.string(),t)])),Dj=j.object({input:j.number(),output:j.number(),cache_read:j.number().optional(),cache_write:j.number().optional(),context_over_200k:j.object({input:j.number(),output:j.number(),cache_read:j.number().optional(),cache_write:j.number().optional()}).optional()}),r=j.object({id:j.string(),name:j.string(),family:j.string().optional(),release_date:j.string(),attachment:j.boolean(),reasoning:j.boolean(),temperature:j.boolean().optional(),tool_call:j.boolean(),interleaved:j.union([j.literal(!0),j.object({field:j.enum(["reasoning_content","reasoning_details"])}).strict()]).optional(),cost:Dj.optional(),limit:j.object({context:j.number(),input:j.number().optional(),output:j.number()}),modalities:j.object({input:j.array(j.enum(["text","audio","image","video","pdf"])),output:j.array(j.enum(["text","audio","image","video","pdf"]))}).optional(),experimental:j.object({modes:j.record(j.string(),j.object({cost:Dj.optional(),provider:j.object({body:j.record(j.string(),t).optional(),headers:j.record(j.string(),j.string()).optional()}).optional()})).optional()}).optional(),status:j.enum(["alpha","beta","deprecated"]).optional(),provider:j.object({npm:j.string().optional(),api:j.string().optional()}).optional()}),e=j.object({api:j.string().optional(),name:j.string(),env:j.array(j.string()),id:j.string(),npm:j.string().optional(),models:j.record(j.string(),r)});var Vj=h.create({service:"models.dev"}),bj=Fj(),F=hj.join(Nj.Path.cache,bj==="https://models.dev"?"models.json":`models-${Ij.fast(bj)}.json`),gj=300000,Aj=8388608,T,dj=j.record(j.string(),e),pj=r,cj=e;function Fj(){return I.QITQODE_MODELS_URL||"https://models.dev"}function lj(){return Date.now()-Number(i.stat(F)?.mtimeMs??0)<gj}function Lj(J){return!J&&lj()}function g(J){let V=dj.parse(typeof J==="string"?JSON.parse(J):J);for(let[_,$]of Object.entries(V))if($.id!==_)throw Error(`Invalid model provider: ${_}`);return V}async function zj(J){let V=await i.readJson(J).catch(()=>{return});if(!V)return;try{return g(V)}catch(_){Vj.warn("Ignoring invalid model catalog cache",{file:J,error:_});return}}async function Pj(J,V,_=Aj){let $=J.headers.get("content-type")?.split(";")[0]?.trim().toLowerCase();if($!=="application/json"&&!$?.endsWith("+json"))throw Error(`Invalid model catalog content type: ${$||"missing"}`);let W=Number(J.headers.get("content-length"));if(Number.isFinite(W)&&W>_)throw Error("Model catalog response is too large");if(!J.body)return"";let w=J.body.getReader(),R=()=>void w.cancel(V.reason);V.addEventListener("abort",R,{once:!0});let G=new Uint8Array(_),q=0;try{for(;;){let B=await w.read();if(B.done)break;if(q+=B.value.byteLength,q>_)throw await w.cancel(),Error("Model catalog response is too large");G.set(B.value,q-B.value.byteLength)}}finally{V.removeEventListener("abort",R)}return new TextDecoder().decode(G.subarray(0,q))}var Tj=async()=>{let J=AbortSignal.timeout(1e4),V=await fetch(`${Fj()}/api.json`,{headers:{"User-Agent":U.USER_AGENT},signal:J});if(!V.ok)return;let _=g(await Pj(V,J));return JSON.stringify(_)},S=vj(async()=>{let J=await zj(I.QITQODE_MODELS_PATH??F);if(J)return J;let V=await import("./chunk-hwrrrbqd.js").then((_)=>g(_.snapshot)).catch(()=>{return});if(V)return V;if(I.QITQODE_DISABLE_MODELS_FETCH)return{};return Jj.withLock(`models-dev:${F}`,async()=>{let _=await zj(I.QITQODE_MODELS_PATH??F);if(_)return _;let $=await Tj();if($)return await i.write(F,$).catch((W)=>{Vj.error("Failed to write models cache",{error:W})}),g($);return{}})});async function fj(){return S()}async function jj(J=!1){if(Lj(J))return S.reset();await Jj.withLock(`models-dev:${F}`,async()=>{if(Lj(J))return S.reset();let V=await Tj();if(!V)return;await i.write(F,V),S.reset()}).catch((V)=>{Vj.error("Failed to fetch models.dev",{error:V})})}function sj(){if(T||I.QITQODE_DISABLE_MODELS_FETCH||process.argv.includes("--get-yargs-completions"))return;jj(),T=setInterval(async()=>{await jj()},3600000),T.unref()}function aj(){if(!T)return;clearInterval(T),T=void 0}
2
+ import{Tl as f,Ul as Gj,Vl as Rj,Wl as Hj,Zl as s}from"./chunk-13rsd5vv.js";import{Jn as xj}from"./chunk-9zm6r55d.js";import{Pn as vj}from"./chunk-khzzmyk2.js";import{$q as Kj,Tq as P,Uq as wj,_q as k}from"./chunk-73r8bjjz.js";import{ds as a,es as y}from"./chunk-kj8cmn7z.js";import{Ns as I,Ws as h}from"./chunk-tr6rdr6h.js";import{ft as i,gt as Ij,ht as Jj,kt as Nj}from"./chunk-at22twxx.js";import{lt as j}from"./chunk-kgptyf7n.js";import{DE as o,TN as C,XJ as l,YE as d,eH as Q,zB as Wj}from"./chunk-qnvsqnz5.js";import{sO as Mj,uO as Oj,wO as Ej}from"./chunk-r9w0thdk.js";var tj={};Oj(tj,{stopRefresh:()=>aj,startRefresh:()=>sj,refresh:()=>jj,readModelCatalogResponse:()=>Pj,get:()=>fj,Provider:()=>cj,Model:()=>pj,MODEL_CATALOG_MAX_BYTES:()=>Aj,Data:()=>S});import hj from"path";var U={};Oj(U,{layer:()=>Bj,isPreview:()=>ij,isNewerVersion:()=>qj,isLocal:()=>mj,getReleaseType:()=>yj,defaultLayer:()=>uj,UpgradeFailedError:()=>x,USER_AGENT:()=>Sj,Service:()=>E,Installation:()=>U,Info:()=>Uj,Event:()=>Cj});var _j=(J)=>J.pipe(k.retryTransient({retryOn:"errors-and-responses",times:2,schedule:d.exponential(200).pipe(d.jittered)}));import Yj from"path";var z=Mj(xj(),1);import n from"crypto";import v from"fs";import Zj from"path";class H extends Error{constructor(J){super(J);this.name="SelfUpdateError"}}function $j(J){let V=J?.platform??process.platform,_=J?.arch??process.arch,$=J?.libc??"bionic",W=["qitqode",V==="win32"?"windows":V,_];if(_==="x64")W.push("baseline");if(V==="linux"&&$==="musl")W.push("musl");return`@qitqode/${W.join("-")}`}function kj(J,V){if(V.integrity){let _=V.integrity.match(/^(sha512|sha384|sha256)-([A-Za-z0-9+/=]+)$/);if(!_)throw new H(`registry returned an unrecognized integrity string: ${V.integrity}`);if(n.createHash(_[1]).update(J).digest("base64")!==_[2])throw new H(`checksum mismatch: downloaded tarball does not match the registry ${_[1]} integrity value; refusing to install`);return}if(V.shasum){if(n.createHash("sha1").update(J).digest("hex")!==V.shasum.toLowerCase())throw new H("checksum mismatch: downloaded tarball does not match the registry shasum; refusing to install");return}throw new H("registry provided no integrity metadata for the tarball; refusing to install")}function Qj(J,V){let _=(w,R)=>{let G=w,q=w+R;while(G<q&&J[G]!==0)G++;return new TextDecoder().decode(J.subarray(w,G))},$=0,W;while($+512<=J.length){if(J.subarray($,$+512).every((Z)=>Z===0))break;let R=_($+124,12).trim(),G=R?parseInt(R,8):0;if(!Number.isFinite(G)||G<0)throw new H("downloaded tarball is corrupt (bad tar header)");let q=String.fromCharCode(J[$+156]),B=_($,100),N=_($+345,155);if(N)B=`${N}/${B}`;if(W)B=W,W=void 0;let b=$+512,X=b+G;if(q==="L")W=new TextDecoder().decode(J.subarray(b,X)).replace(/\0+$/,"");else if((q==="0"||q==="\x00"||q==="")&&B===V)return J.slice(b,X);$=b+Math.ceil(G/512)*512}return}var A=(J)=>String(J instanceof Error?J.message:J),u=(J)=>Q.fail(new H(J)),p=(J,V)=>Q.try({try:J,catch:(_)=>new H(V(_))}),Xj=Q.fnUntraced(function*(J){let{target:V,execPath:_,packageName:$,registry:W}=J,w=J.gunzip??((K)=>Bun.gunzipSync(K)),R=Zj.dirname(_);yield*p(()=>v.accessSync(R,v.constants.W_OK),()=>`no write permission for ${R}; cannot replace ${_}. Fix the directory permissions or re-run with sufficient privileges.`);let G=`${W}/${$}/${encodeURIComponent(V)}`,B=(yield*J.fetchJson(G).pipe(Q.mapError((K)=>new H(`download failed: could not fetch ${$}@${V} from ${W} (${A(K)}). Check your network connection and that version ${V} exists.`))))?.dist;if(!B?.tarball)return yield*u(`registry response for ${$}@${V} has no tarball URL; cannot self-update`);let N=B.tarball,b=yield*J.fetchBytes(N).pipe(Q.mapError((K)=>new H(`download failed: could not download ${N} (${A(K)}). Check your network connection and try again.`)));yield*Q.try({try:()=>kj(b,B),catch:(K)=>K instanceof H?K:new H(A(K))});let X=yield*Q.try({try:()=>w(b),catch:()=>new H("downloaded tarball is corrupt (gunzip failed); try again")}),Z=Qj(X,"package/bin/qitqode")??Qj(X,"package/bin/qitqode.exe");if(!Z||Z.length===0)return yield*u(`tarball for ${$}@${V} does not contain the expected binary at bin/qitqode`);let O=Zj.join(R,`.qitqode-upgrade-${process.pid}`),Y=`${_}.backup-${process.pid}`,D=(K)=>{try{v.rmSync(K,{force:!0})}catch{}};yield*p(()=>v.writeFileSync(O,Z,{mode:493}),(K)=>{return D(O),`no write permission: could not write ${O} (${A(K)})`});let L=yield*J.runVersion(O).pipe(Q.mapError((K)=>{return D(O),new H(`downloaded binary failed its --version check (${A(K)}); keeping the current installation`)}));if(L.code!==0)return D(O),yield*u(`downloaded binary failed its --version check (exit ${L.code}); keeping the current installation`);let m=L.stdout.trim();if(m&&!m.includes(V))return D(O),yield*u(`downloaded binary reports version "${m}" instead of ${V}; keeping the current installation`);yield*p(()=>v.renameSync(_,Y),(K)=>{return D(O),`could not move the current binary aside (${A(K)}); check permissions on ${_}`}),yield*Q.try({try:()=>v.renameSync(O,_),catch:(K)=>{try{v.renameSync(Y,_)}catch{return new H(`failed to install the new binary AND failed to restore the old one; your previous binary is preserved at ${Y} \u2014 move it back to ${_} manually`)}return D(O),new H(`could not install the new binary (${A(K)}); the previous version was restored`)}}),D(Y)});var c=h.create({service:"installation"}),M="@qitqode/cli";function qj(J,V){if(!z.default.valid(J)||!z.default.valid(V))return!1;return z.default.gt(V,J)}var Cj={Updated:s.define("installation.updated",j.object({version:j.string()})),UpdateAvailable:s.define("installation.update-available",j.object({version:j.string()}))};function yj(J,V){if(!qj(J,V))throw Error(`Version ${V} is not newer than ${J}`);let _=z.default.major(J),$=z.default.minor(J),W=z.default.major(V),w=z.default.minor(V);if(W>_)return"major";if(w>$)return"minor";return"patch"}var Uj=j.object({version:j.string(),latest:j.string()}).meta({ref:"InstallationInfo"}),Sj=`qitqode/${y}/${a}/${I.QITQODE_CLIENT}`;function ij(){return y!=="latest"}function mj(){return y==="local"}class x extends C.TaggedErrorClass()("UpgradeFailedError",{stderr:C.String}){}var nj=C.Struct({version:C.String});class E extends Wj.Service()("@qitqode/Installation"){}var Bj=o.effect(E,Q.gen(function*(){let J=yield*k.HttpClient,V=k.filterStatusOk(_j(J)),_=yield*f.ChildProcessSpawner,$=(X,Z)=>Gj.make(X[0],X.slice(1),{cwd:Z?.cwd,env:Z?.env,extendEnv:!0}),W=Q.fnUntraced(function*(X){let Z=yield*Hj(_,X);return{code:Z.code,stdout:Z.text,stderr:Z.stderr}},Q.scoped),w=Q.fnUntraced(function*(X,Z){let O=yield*_.spawn($(X,Z)),Y=yield*l.mkString(l.decodeText(O.stdout));return yield*O.exitCode,Y},Q.scoped,Q.catch(()=>Q.succeed(""))),R=Q.fnUntraced(function*(X,Z){return yield*W($(X,Z))},Q.catch(()=>Q.succeed({code:f.ExitCode(1),stdout:"",stderr:""}))),G=Q.fn("Installation.method")(function*(){if(process.execPath.includes(Yj.join(".qitqode","bin")))return"curl";if(process.execPath.includes(Yj.join(".local","bin")))return"curl";let X=process.execPath.toLowerCase(),Z=[{name:"npm",command:()=>w(["npm","list","-g","--depth=0"])},{name:"pnpm",command:()=>w(["pnpm","list","-g","--depth=0"])},{name:"bun",command:()=>w(["bun","pm","ls","-g"])}];Z.sort((O,Y)=>{let D=X.includes(O.name),L=X.includes(Y.name);if(D&&!L)return-1;if(!D&&L)return 1;return 0});for(let O of Z)if((yield*O.command()).includes(M))return O.name;return"unknown"}),q=Q.fn("Installation.latest")(function*(X){let Z=X||(yield*G());if(Z==="curl"){let Y=(yield*w(["curl","-sI","https://github.com/qitqode/qitqode/releases/latest"])).match(/^location:.*\/tag\/v([0-9][^\s/]*)/im);if(Y)return Y[1];return yield*Q.die(Error("failed to resolve latest version from GitHub releases redirect"))}if(Z==="npm"||Z==="bun"||Z==="pnpm"){let Y=(yield*w(["npm","config","get","registry"])).trim()||"https://registry.npmjs.org",D=Y.endsWith("/")?Y.slice(0,-1):Y,L=yield*V.execute(P.get(`${D}/${encodeURIComponent(M)}/${y}`).pipe(P.acceptJson));return(yield*wj.schemaBodyJson(nj)(L)).version}return c.warn("unsupported update channel, skipping",{method:Z}),yield*Q.die(Error(`unsupported update channel: ${Z}`))},Q.orDie),B=Q.fnUntraced(function*(){let Z=(yield*w(["npm","config","get","registry"])).trim()||"https://registry.npmjs.org";return Z.endsWith("/")?Z.slice(0,-1):Z}),N=Q.fnUntraced(function*(X){let Z=yield*B();yield*Xj({target:X,execPath:process.env.QITQODE_SELF_UPDATE_TARGET_BINARY||process.execPath,packageName:$j(),registry:Z,fetchJson:(O)=>V.execute(P.get(O).pipe(P.acceptJson)).pipe(Q.flatMap((Y)=>Y.json)),fetchBytes:(O)=>V.execute(P.get(O)).pipe(Q.flatMap((Y)=>Y.arrayBuffer),Q.map((Y)=>new Uint8Array(Y))),runVersion:(O)=>R([O,"--version"]).pipe(Q.map((Y)=>({code:Y.code,stdout:Y.stdout})))}).pipe(Q.mapError((O)=>new x({stderr:O.message})))}),b=Q.fn("Installation.upgrade")(function*(X,Z){if(X==="curl"){yield*N(Z),c.info("upgraded",{method:X,target:Z});return}let Y=yield*(()=>{if(X==="npm")return R(["npm","install","-g",`${M}@${Z}`]);if(X==="pnpm")return R(["pnpm","install","-g",`${M}@${Z}`]);if(X==="bun")return R(["bun","install","-g",`${M}@${Z}`]);return new x({stderr:`Unknown method: ${X}`})})();if(Y.code!==0){let D=Y.stderr||"";return yield*new x({stderr:D})}c.info("upgraded",{method:X,target:Z,stdout:Y.stdout,stderr:Y.stderr}),yield*w([process.execPath,"--version"])});return E.of({info:Q.fn("Installation.info")(function*(){return{version:a,latest:yield*q()}}),method:G,latest:q,upgrade:b})})),uj=Bj.pipe(o.provide(Kj.layer),o.provide(Rj));var t=j.lazy(()=>j.union([j.string(),j.number(),j.boolean(),j.null(),j.array(t),j.record(j.string(),t)])),Dj=j.object({input:j.number(),output:j.number(),cache_read:j.number().optional(),cache_write:j.number().optional(),context_over_200k:j.object({input:j.number(),output:j.number(),cache_read:j.number().optional(),cache_write:j.number().optional()}).optional()}),r=j.object({id:j.string(),name:j.string(),family:j.string().optional(),release_date:j.string(),attachment:j.boolean(),reasoning:j.boolean(),temperature:j.boolean().optional(),tool_call:j.boolean(),interleaved:j.union([j.literal(!0),j.object({field:j.enum(["reasoning_content","reasoning_details"])}).strict()]).optional(),cost:Dj.optional(),limit:j.object({context:j.number(),input:j.number().optional(),output:j.number()}),modalities:j.object({input:j.array(j.enum(["text","audio","image","video","pdf"])),output:j.array(j.enum(["text","audio","image","video","pdf"]))}).optional(),experimental:j.object({modes:j.record(j.string(),j.object({cost:Dj.optional(),provider:j.object({body:j.record(j.string(),t).optional(),headers:j.record(j.string(),j.string()).optional()}).optional()})).optional()}).optional(),status:j.enum(["alpha","beta","deprecated"]).optional(),provider:j.object({npm:j.string().optional(),api:j.string().optional()}).optional()}),e=j.object({api:j.string().optional(),name:j.string(),env:j.array(j.string()),id:j.string(),npm:j.string().optional(),models:j.record(j.string(),r)});var Vj=h.create({service:"models.dev"}),bj=Fj(),F=hj.join(Nj.Path.cache,bj==="https://models.dev"?"models.json":`models-${Ij.fast(bj)}.json`),gj=300000,Aj=8388608,T,dj=j.record(j.string(),e),pj=r,cj=e;function Fj(){return I.QITQODE_MODELS_URL||"https://models.dev"}function lj(){return Date.now()-Number(i.stat(F)?.mtimeMs??0)<gj}function Lj(J){return!J&&lj()}function g(J){let V=dj.parse(typeof J==="string"?JSON.parse(J):J);for(let[_,$]of Object.entries(V))if($.id!==_)throw Error(`Invalid model provider: ${_}`);return V}async function zj(J){let V=await i.readJson(J).catch(()=>{return});if(!V)return;try{return g(V)}catch(_){Vj.warn("Ignoring invalid model catalog cache",{file:J,error:_});return}}async function Pj(J,V,_=Aj){let $=J.headers.get("content-type")?.split(";")[0]?.trim().toLowerCase();if($!=="application/json"&&!$?.endsWith("+json"))throw Error(`Invalid model catalog content type: ${$||"missing"}`);let W=Number(J.headers.get("content-length"));if(Number.isFinite(W)&&W>_)throw Error("Model catalog response is too large");if(!J.body)return"";let w=J.body.getReader(),R=()=>void w.cancel(V.reason);V.addEventListener("abort",R,{once:!0});let G=new Uint8Array(_),q=0;try{for(;;){let B=await w.read();if(B.done)break;if(q+=B.value.byteLength,q>_)throw await w.cancel(),Error("Model catalog response is too large");G.set(B.value,q-B.value.byteLength)}}finally{V.removeEventListener("abort",R)}return new TextDecoder().decode(G.subarray(0,q))}var Tj=async()=>{let J=AbortSignal.timeout(1e4),V=await fetch(`${Fj()}/api.json`,{headers:{"User-Agent":U.USER_AGENT},signal:J});if(!V.ok)return;let _=g(await Pj(V,J));return JSON.stringify(_)},S=vj(async()=>{let J=await zj(I.QITQODE_MODELS_PATH??F);if(J)return J;let V=await import("./chunk-hwrrrbqd.js").then((_)=>g(_.snapshot)).catch(()=>{return});if(V)return V;if(I.QITQODE_DISABLE_MODELS_FETCH)return{};return Jj.withLock(`models-dev:${F}`,async()=>{let _=await zj(I.QITQODE_MODELS_PATH??F);if(_)return _;let $=await Tj();if($)return await i.write(F,$).catch((W)=>{Vj.error("Failed to write models cache",{error:W})}),g($);return{}})});async function fj(){return S()}async function jj(J=!1){if(Lj(J))return S.reset();await Jj.withLock(`models-dev:${F}`,async()=>{if(Lj(J))return S.reset();let V=await Tj();if(!V)return;await i.write(F,V),S.reset()}).catch((V)=>{Vj.error("Failed to fetch models.dev",{error:V})})}function sj(){if(T||I.QITQODE_DISABLE_MODELS_FETCH||process.argv.includes("--get-yargs-completions"))return;jj(),T=setInterval(async()=>{await jj()},3600000),T.unref()}function aj(){if(!T)return;clearInterval(T),T=void 0}
3
3
  export{_j as el,U as fl,Aj as gl,pj as hl,cj as il,Pj as jl,S as kl,fj as ll,jj as ml,sj as nl,aj as ol,tj as pl};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{X as o,Z as s}from"./chunk-5ysbwr4x.js";import{_ as i}from"./chunk-e8p92vz4.js";import{Pd as p}from"./chunk-k2g8346v.js";import{ae as n}from"./chunk-5w76kdjr.js";import{dg as B}from"./chunk-eg3syjtv.js";import{kg as l}from"./chunk-ckb1y6gv.js";import"./chunk-j4ad3mde.js";import"./chunk-kp6gh35c.js";import"./chunk-8q38721t.js";import"./chunk-f0t7rryn.js";import"./chunk-nfg7nt13.js";import"./chunk-450fef7h.js";import"./chunk-3zrr4n6k.js";import{Bh as g,qh as d}from"./chunk-r6p0bd2w.js";import"./chunk-w46g7kdq.js";import"./chunk-bd21p9zz.js";import"./chunk-p54bzjtv.js";import"./chunk-ha1w0xzh.js";import"./chunk-6m9jb0s9.js";import"./chunk-vygkwwjd.js";import{Tk as f}from"./chunk-twp3mjj0.js";import"./chunk-6pe60dsw.js";import"./chunk-jdx3jshm.js";import"./chunk-6v5867cy.js";import"./chunk-mh19kwzw.js";import"./chunk-7j4qne3q.js";import"./chunk-snqa3zsm.js";import"./chunk-9zm6r55d.js";import"./chunk-vcygx6hs.js";import"./chunk-khzzmyk2.js";import"./chunk-y7hgevfv.js";import"./chunk-47k5jy1p.js";import{ao as D}from"./chunk-ab4dq1bn.js";import"./chunk-ph8hn1wt.js";import"./chunk-ptqk1j2r.js";import"./chunk-cqtkxwd8.js";import"./chunk-pr7z5dj8.js";import"./chunk-dnnkq5y4.js";import"./chunk-t239rvej.js";import"./chunk-yz25607t.js";import"./chunk-7hvf9dgx.js";import"./chunk-wkg3c643.js";import"./chunk-fhqfqd5v.js";import"./chunk-cx78hhbx.js";import"./chunk-xv5z1bj6.js";import"./chunk-73r8bjjz.js";import{Er as I}from"./chunk-w88ve2pm.js";import"./chunk-ztyy3ga3.js";import"./chunk-mmjgf680.js";import"./chunk-nj1ntakd.js";import"./chunk-cmb62jkt.js";import"./chunk-tkrwcjkr.js";import"./chunk-ztn9e8g1.js";import"./chunk-09geev0j.js";import"./chunk-r5zy4za0.js";import{Ns as u,Ws as x}from"./chunk-tr6rdr6h.js";import{ft as y}from"./chunk-at22twxx.js";import"./chunk-kgptyf7n.js";import"./chunk-j9h1sp4g.js";import"./chunk-p6crzjtf.js";import"./chunk-55fcmswd.js";import"./chunk-qnvsqnz5.js";import"./chunk-pxm4qvqk.js";import"./chunk-j8fcfhr2.js";import"./chunk-r9w0thdk.js";import T from"path";import{pathToFileURL as jj}from"url";import{EOL as Q}from"os";function $(j){let K=j.state;return{input:K.input,metadata:"metadata"in K?K.metadata:{},part:j}}function z(j){let K=j.description?B.Style.TEXT_DIM+` ${j.description}`+B.Style.TEXT_NORMAL:"";B.println(B.Style.TEXT_NORMAL+j.icon,B.Style.TEXT_NORMAL+j.title+K)}function b(j,K){if(B.empty(),z(j),!K?.trim())return;B.println(K),B.empty()}function U(j){let K=j.state,V="input"in K?K.input:void 0,Y=("title"in K&&K.title?K.title:void 0)||(V&&typeof V==="object"&&Object.keys(V).length>0?JSON.stringify(V):"Unknown");z({icon:"\u2699",title:`${j.tool} ${Y}`})}function t(j){let K=j.path??"",V=`${j.kind} "${j.pattern}"`,Y=K?`in ${q(K)}`:"",H=j.count===void 0?Y:`${Y}${Y?" \xB7 ":""}${j.count} ${j.count===1?"match":"matches"}`;z({icon:"\u2731",title:V,...H&&{description:H}})}function Bj(j){t({kind:"Glob",pattern:j.input.pattern,path:j.input.path,count:j.metadata.count})}function Gj(j){t({kind:"Grep",pattern:j.input.pattern,path:j.input.path,count:j.metadata.matches})}function Jj(j){let K=q(j.input.filePath),V=Object.entries(j.input).filter(([H,S])=>{if(H==="filePath")return!1;return typeof S==="string"||typeof S==="number"||typeof S==="boolean"}),Y=V.length?`[${V.map(([H,S])=>`${H}=${S}`).join(", ")}]`:void 0;z({icon:"\u2192",title:`Read ${K}`,...Y&&{description:Y}})}function Kj(j){b({icon:"\u2190",title:`Write ${q(j.input.filePath)}`},j.part.state.status==="completed"?j.part.state.output:void 0)}function Mj(j){z({icon:"%",title:`WebFetch ${j.input.url}`})}function Nj(j){let K=q(j.input.filePath),V=j.metadata.diff;b({icon:"\u2190",title:`Edit ${K}`},V)}function Vj(j){z({icon:"\u25C7",title:`Exa Code Search "${j.input.query}"`})}function Xj(j){z({icon:"\u25C8",title:`Web Search "${j.input.query}"`})}function k(j){let K=j.part.state.input?.operation??j.part.state.input,V=j.part.state.status,Y=typeof K?.subagent_type==="string"&&K.subagent_type.trim().length>0?K.subagent_type:"unknown",H=I.titlecase(Y),S=typeof K?.description==="string"&&K.description.trim().length>0?K.description:void 0,w=V==="error"?"\u2717":V==="running"?"\u2022":"\u2713",L=S??`${H} Task`;z({icon:w,title:L,description:S?`${H} Agent`:void 0})}function Yj(j){z({icon:"\u2192",title:`Skill "${j.input.name}"`})}function Zj(j){let K=j.part.state.status==="completed"?j.part.state.output?.trim():void 0;b({icon:"$",title:`${j.input.command}`},K)}function q(j){if(!j)return"";if(T.isAbsolute(j))return T.relative(process.cwd(),j)||".";return j}var Pj=n({command:"run [message..]",describe:"run qitqode with a message",builder:(j)=>{return j.positional("message",{describe:"message to send",type:"string",array:!0,default:[]}).option("command",{describe:"the command to run, use message for args",type:"string"}).option("continue",{alias:["c"],describe:"continue the last session",type:"boolean"}).option("session",{alias:["s"],describe:"session id to continue",type:"string"}).option("fork",{describe:"fork the session before continuing (requires --continue or --session)",type:"boolean"}).option("share",{type:"boolean",describe:"share the session"}).option("model",{type:"string",alias:["m"],describe:"model to use in the format of provider/model"}).option("agent",{type:"string",describe:"agent to use"}).option("format",{type:"string",choices:["default","json"],default:"default",describe:"format: default (formatted) or json (raw JSON events)"}).option("file",{alias:["f"],type:"string",array:!0,describe:"file(s) to attach to message"}).option("title",{type:"string",describe:"title for the session (uses truncated prompt if no value provided)"}).option("attach",{type:"string",describe:"attach to a running qitqode server (e.g., http://localhost:4096)"}).option("password",{alias:["p"],type:"string",describe:"basic auth password (defaults to QITQODE_SERVER_PASSWORD)"}).option("dir",{type:"string",describe:"directory to run in, path on remote server if attaching"}).option("port",{type:"number",describe:"port for the local server (defaults to random port if no value provided)"}).option("variant",{type:"string",describe:"model variant (provider-specific reasoning effort, e.g., high, max, minimal)"}).option("thinking",{type:"boolean",describe:"show thinking blocks",default:!1}).option("dangerously-skip-permissions",{type:"boolean",describe:"auto-approve permissions that are not explicitly denied (dangerous!)",default:!1})},handler:async(j)=>{let K=[...j.message,...j["--"]||[]].join(" "),V=(()=>{if(!j.dir)return;if(j.attach)return j.dir;try{return process.chdir(j.dir),process.cwd()}catch{B.error("Failed to change directory to "+j.dir),process.exit(1)}})(),Y=[];if(j.file){let M=Array.isArray(j.file)?j.file:[j.file];for(let X of M){let N=T.resolve(process.cwd(),X);if(!await y.exists(N))B.error(`File not found: ${X}`),process.exit(1);let W=await y.isDir(N)?"application/x-directory":"text/plain";Y.push({type:"file",url:jj(N).href,filename:T.basename(N),mime:W})}}if(!process.stdin.isTTY)K+=`
2
+ import{X as o,Z as s}from"./chunk-5ysbwr4x.js";import{_ as i}from"./chunk-e8p92vz4.js";import{Pd as p}from"./chunk-2nv1scj9.js";import{ae as n}from"./chunk-5w76kdjr.js";import{dg as B}from"./chunk-eg3syjtv.js";import{kg as l}from"./chunk-vp9scf28.js";import"./chunk-kdj7xvz7.js";import"./chunk-0j5rzaxx.js";import"./chunk-36xm6mgm.js";import"./chunk-f0t7rryn.js";import"./chunk-nfg7nt13.js";import"./chunk-450fef7h.js";import"./chunk-yfzyzsr4.js";import{Bh as g,qh as d}from"./chunk-v3nqkqhz.js";import"./chunk-w46g7kdq.js";import"./chunk-bd21p9zz.js";import"./chunk-p54bzjtv.js";import"./chunk-ha1w0xzh.js";import"./chunk-6m9jb0s9.js";import"./chunk-vygkwwjd.js";import{Tk as f}from"./chunk-52frd9p0.js";import"./chunk-xqnzmr7a.js";import"./chunk-r1xh50b2.js";import"./chunk-13rsd5vv.js";import"./chunk-mh19kwzw.js";import"./chunk-a9a0cwmf.js";import"./chunk-nw3e93y8.js";import"./chunk-9zm6r55d.js";import"./chunk-vcygx6hs.js";import"./chunk-khzzmyk2.js";import"./chunk-y7hgevfv.js";import"./chunk-47k5jy1p.js";import{ao as D}from"./chunk-kn8w69g9.js";import"./chunk-ph8hn1wt.js";import"./chunk-ptqk1j2r.js";import"./chunk-cqtkxwd8.js";import"./chunk-pr7z5dj8.js";import"./chunk-dnnkq5y4.js";import"./chunk-t239rvej.js";import"./chunk-yz25607t.js";import"./chunk-7hvf9dgx.js";import"./chunk-wkg3c643.js";import"./chunk-fhqfqd5v.js";import"./chunk-2b3fn9xv.js";import"./chunk-rn043d0r.js";import"./chunk-73r8bjjz.js";import{Er as I}from"./chunk-t5xxs5kp.js";import"./chunk-ztyy3ga3.js";import"./chunk-mmjgf680.js";import"./chunk-nj1ntakd.js";import"./chunk-cmb62jkt.js";import"./chunk-tkrwcjkr.js";import"./chunk-w2cb8cry.js";import"./chunk-kj8cmn7z.js";import"./chunk-r5zy4za0.js";import{Ns as u,Ws as x}from"./chunk-tr6rdr6h.js";import{ft as y}from"./chunk-at22twxx.js";import"./chunk-kgptyf7n.js";import"./chunk-j9h1sp4g.js";import"./chunk-p6crzjtf.js";import"./chunk-55fcmswd.js";import"./chunk-qnvsqnz5.js";import"./chunk-pxm4qvqk.js";import"./chunk-j8fcfhr2.js";import"./chunk-r9w0thdk.js";import T from"path";import{pathToFileURL as jj}from"url";import{EOL as Q}from"os";function $(j){let K=j.state;return{input:K.input,metadata:"metadata"in K?K.metadata:{},part:j}}function z(j){let K=j.description?B.Style.TEXT_DIM+` ${j.description}`+B.Style.TEXT_NORMAL:"";B.println(B.Style.TEXT_NORMAL+j.icon,B.Style.TEXT_NORMAL+j.title+K)}function b(j,K){if(B.empty(),z(j),!K?.trim())return;B.println(K),B.empty()}function U(j){let K=j.state,V="input"in K?K.input:void 0,Y=("title"in K&&K.title?K.title:void 0)||(V&&typeof V==="object"&&Object.keys(V).length>0?JSON.stringify(V):"Unknown");z({icon:"\u2699",title:`${j.tool} ${Y}`})}function t(j){let K=j.path??"",V=`${j.kind} "${j.pattern}"`,Y=K?`in ${q(K)}`:"",H=j.count===void 0?Y:`${Y}${Y?" \xB7 ":""}${j.count} ${j.count===1?"match":"matches"}`;z({icon:"\u2731",title:V,...H&&{description:H}})}function Bj(j){t({kind:"Glob",pattern:j.input.pattern,path:j.input.path,count:j.metadata.count})}function Gj(j){t({kind:"Grep",pattern:j.input.pattern,path:j.input.path,count:j.metadata.matches})}function Jj(j){let K=q(j.input.filePath),V=Object.entries(j.input).filter(([H,S])=>{if(H==="filePath")return!1;return typeof S==="string"||typeof S==="number"||typeof S==="boolean"}),Y=V.length?`[${V.map(([H,S])=>`${H}=${S}`).join(", ")}]`:void 0;z({icon:"\u2192",title:`Read ${K}`,...Y&&{description:Y}})}function Kj(j){b({icon:"\u2190",title:`Write ${q(j.input.filePath)}`},j.part.state.status==="completed"?j.part.state.output:void 0)}function Mj(j){z({icon:"%",title:`WebFetch ${j.input.url}`})}function Nj(j){let K=q(j.input.filePath),V=j.metadata.diff;b({icon:"\u2190",title:`Edit ${K}`},V)}function Vj(j){z({icon:"\u25C7",title:`Exa Code Search "${j.input.query}"`})}function Xj(j){z({icon:"\u25C8",title:`Web Search "${j.input.query}"`})}function k(j){let K=j.part.state.input?.operation??j.part.state.input,V=j.part.state.status,Y=typeof K?.subagent_type==="string"&&K.subagent_type.trim().length>0?K.subagent_type:"unknown",H=I.titlecase(Y),S=typeof K?.description==="string"&&K.description.trim().length>0?K.description:void 0,w=V==="error"?"\u2717":V==="running"?"\u2022":"\u2713",L=S??`${H} Task`;z({icon:w,title:L,description:S?`${H} Agent`:void 0})}function Yj(j){z({icon:"\u2192",title:`Skill "${j.input.name}"`})}function Zj(j){let K=j.part.state.status==="completed"?j.part.state.output?.trim():void 0;b({icon:"$",title:`${j.input.command}`},K)}function q(j){if(!j)return"";if(T.isAbsolute(j))return T.relative(process.cwd(),j)||".";return j}var Pj=n({command:"run [message..]",describe:"run qitqode with a message",builder:(j)=>{return j.positional("message",{describe:"message to send",type:"string",array:!0,default:[]}).option("command",{describe:"the command to run, use message for args",type:"string"}).option("continue",{alias:["c"],describe:"continue the last session",type:"boolean"}).option("session",{alias:["s"],describe:"session id to continue",type:"string"}).option("fork",{describe:"fork the session before continuing (requires --continue or --session)",type:"boolean"}).option("share",{type:"boolean",describe:"share the session"}).option("model",{type:"string",alias:["m"],describe:"model to use in the format of provider/model"}).option("agent",{type:"string",describe:"agent to use"}).option("format",{type:"string",choices:["default","json"],default:"default",describe:"format: default (formatted) or json (raw JSON events)"}).option("file",{alias:["f"],type:"string",array:!0,describe:"file(s) to attach to message"}).option("title",{type:"string",describe:"title for the session (uses truncated prompt if no value provided)"}).option("attach",{type:"string",describe:"attach to a running qitqode server (e.g., http://localhost:4096)"}).option("password",{alias:["p"],type:"string",describe:"basic auth password (defaults to QITQODE_SERVER_PASSWORD)"}).option("dir",{type:"string",describe:"directory to run in, path on remote server if attaching"}).option("port",{type:"number",describe:"port for the local server (defaults to random port if no value provided)"}).option("variant",{type:"string",describe:"model variant (provider-specific reasoning effort, e.g., high, max, minimal)"}).option("thinking",{type:"boolean",describe:"show thinking blocks",default:!1}).option("dangerously-skip-permissions",{type:"boolean",describe:"auto-approve permissions that are not explicitly denied (dangerous!)",default:!1})},handler:async(j)=>{let K=[...j.message,...j["--"]||[]].join(" "),V=(()=>{if(!j.dir)return;if(j.attach)return j.dir;try{return process.chdir(j.dir),process.cwd()}catch{B.error("Failed to change directory to "+j.dir),process.exit(1)}})(),Y=[];if(j.file){let M=Array.isArray(j.file)?j.file:[j.file];for(let X of M){let N=T.resolve(process.cwd(),X);if(!await y.exists(N))B.error(`File not found: ${X}`),process.exit(1);let W=await y.isDir(N)?"application/x-directory":"text/plain";Y.push({type:"file",url:jj(N).href,filename:T.basename(N),mime:W})}}if(!process.stdin.isTTY)K+=`
3
3
  `+await Bun.stdin.text();if(K.trim().length===0&&!j.command)B.error("You must provide a message or a command"),process.exit(1);if(j.fork&&!j.continue&&!j.session)B.error("--fork requires --continue or --session"),process.exit(1);let H=[{permission:"question",action:"deny",pattern:"*"},{permission:"plan_enter",action:"deny",pattern:"*"},{permission:"plan_exit",action:"deny",pattern:"*"}];function S(){if(j.title===void 0)return;if(j.title!=="")return j.title;return K.slice(0,50)+(K.length>50?"...":"")}async function w(M){let X=j.continue?(await M.session.list()).data?.find((Z)=>!Z.parentID)?.id:j.session;if(X&&j.fork)return(await M.session.fork({sessionID:X})).data?.id;if(X)return X;let N=S();return(await M.session.create({title:N,permission:H})).data?.id}async function L(M,X){let N=await M.config.get();if(!N.data)return;if(N.data.share!=="auto"&&!u.QITQODE_AUTO_SHARE&&!j.share)return;let W=await M.session.share({sessionID:X}).catch((Z)=>{if(Z instanceof Error&&Z.message.includes("disabled"))B.println(B.Style.TEXT_DANGER_BOLD+"! "+Z.message);return{error:Z}});if(!W.error&&"data"in W&&W.data?.share?.url)B.println(B.Style.TEXT_INFO_BOLD+"~ "+W.data.share.url)}async function h(M){function X(G){try{if(G.tool==="bash")return Zj($(G));if(G.tool==="glob")return Bj($(G));if(G.tool==="grep")return Gj($(G));if(G.tool==="read")return Jj($(G));if(G.tool==="write")return Kj($(G));if(G.tool==="webfetch")return Mj($(G));if(G.tool==="edit")return Nj($(G));if(G.tool==="codesearch")return Vj($(G));if(G.tool==="websearch")return Xj($(G));if(G.tool==="actor")return k($(G));if(G.tool==="skill")return Yj($(G));return U(G)}catch{return U(G)}}function N(G,A){if(j.format==="json")return process.stdout.write(JSON.stringify({type:G,timestamp:Date.now(),sessionID:C,...A})+Q),!0;return!1}let W=await M.event.subscribe(),Z;async function e(G){let A=new Map,E=x.create({service:"cli.run"}),F=W.stream[Symbol.asyncIterator](),O=G.completion.then(()=>"DONE");try{while(!0){let P=await Promise.race([F.next(),O]);if(P==="DONE")break;if(P.done)break;let _=P.value;if(G.onEvent(_),E.debug("event received",{type:_.type}),_.type==="message.updated"&&_.properties.info.role==="assistant"&&j.format!=="json"&&A.get("start")!==!0)B.empty(),B.println(`> ${_.properties.info.agent} \xB7 ${_.properties.info.modelID}`),B.empty(),A.set("start",!0);if(_.type==="message.part.updated"){let J=_.properties.part;if(J.sessionID!==C)continue;if(J.type==="tool"&&(J.state.status==="completed"||J.state.status==="error")){if(N("tool_use",{part:J}))continue;if(J.state.status==="completed"){X(J);continue}z({icon:"\u2717",title:`${J.tool} failed`}),B.error(J.state.error)}if(J.type==="tool"&&J.tool==="actor"&&J.state.status==="running"&&j.format!=="json"){if(A.get(J.id)===!0)continue;k($(J)),A.set(J.id,!0)}if(J.type==="step-start"){if(N("step_start",{part:J}))continue}if(J.type==="step-finish"){if(N("step_finish",{part:J}))continue}if(J.type==="text"&&J.time?.end){if(N("text",{part:J}))continue;let R=J.text.trim();if(!R)continue;if(!process.stdout.isTTY){process.stdout.write(R+Q);continue}B.empty(),B.println(R),B.empty()}if(J.type==="reasoning"&&J.time?.end&&j.thinking){if(N("reasoning",{part:J}))continue;let R=J.text.trim();if(!R)continue;let c=`Thinking: ${R}`;if(process.stdout.isTTY){B.empty(),B.println(`${B.Style.TEXT_DIM}\x1B[3m${c}\x1B[0m${B.Style.TEXT_NORMAL}`),B.empty();continue}process.stdout.write(c+Q)}}if(_.type==="session.error"){let J=_.properties;if(J.sessionID!==C||!J.error)continue;let R=String(J.error.name);if("data"in J.error&&J.error.data&&"message"in J.error.data)R=String(J.error.data.message);if(Z=Z?Z+Q+R:R,N("error",{error:J.error}))continue;B.error(R)}if(_.type==="permission.asked"){let J=_.properties;if(J.sessionID!==C)continue;if(j["dangerously-skip-permissions"])await M.permission.reply({requestID:J.id,reply:"once"});else B.println(B.Style.TEXT_WARNING_BOLD+"!",B.Style.TEXT_NORMAL+`permission requested: ${J.permission} (${J.patterns.join(", ")}); auto-rejecting`),await M.permission.reply({requestID:J.id,reply:"reject"})}}}finally{G.stop(),await F.return?.(void 0).catch(()=>{})}}let a=await(async()=>{if(!j.agent)return;let G=j.agent;if(j.attach){let E=await M.app.agents(void 0,{throwOnError:!0}).then((O)=>O.data??[]).catch(()=>{return});if(!E){B.println(B.Style.TEXT_WARNING_BOLD+"!",B.Style.TEXT_NORMAL,`failed to list agents from ${j.attach}. Falling back to default agent`);return}let F=E.find((O)=>O.name===G);if(!F){B.println(B.Style.TEXT_WARNING_BOLD+"!",B.Style.TEXT_NORMAL,`agent "${G}" not found. Falling back to default agent`);return}if(F.mode==="subagent"){B.println(B.Style.TEXT_WARNING_BOLD+"!",B.Style.TEXT_NORMAL,`agent "${G}" is a subagent, not a primary agent. Falling back to default agent`);return}return G}let A=await g.runPromise(d.Service.use((E)=>E.get(G)));if(!A){B.println(B.Style.TEXT_WARNING_BOLD+"!",B.Style.TEXT_NORMAL,`agent "${G}" not found. Falling back to default agent`);return}if(A.mode==="subagent"){B.println(B.Style.TEXT_WARNING_BOLD+"!",B.Style.TEXT_NORMAL,`agent "${G}" is a subagent, not a primary agent. Falling back to default agent`);return}return G})(),v=s(a),C=await w(M);if(!C)B.error("Session not found"),process.exit(1);await L(M,C);let r=x.create({service:"cli.run.poll"}),m=o({sessionID:C,query:async()=>{try{return(await M.session.status()).data?.[C]}catch(G){throw r.debug("session.status query failed",{error:G}),G}}});if(e(m).catch((G)=>{console.error(G),process.exit(1)}),j.command)await M.session.command({sessionID:C,agent:v,model:j.model,command:j.command,arguments:K,variant:j.variant});else{let G=j.model?f.parseModel(j.model):void 0;await M.session.prompt({sessionID:C,agent:v,model:G,variant:j.variant,parts:[...Y,{type:"text",text:K}]})}m.markStarted()}if(j.attach){let M=i({password:j.password}),X=D({baseUrl:j.attach,directory:V,headers:M});return await h(X)}await p(process.cwd(),async()=>{let X=D({baseUrl:"http://qitqode.internal",fetch:async(N,W)=>{let Z=new Request(N,W);return l.Default().app.fetch(Z)}});await h(X)})}});export{Pj as RunCommand};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{kg as E}from"./chunk-ckb1y6gv.js";import"./chunk-j4ad3mde.js";import"./chunk-kp6gh35c.js";import"./chunk-8q38721t.js";import"./chunk-f0t7rryn.js";import"./chunk-nfg7nt13.js";import"./chunk-450fef7h.js";import"./chunk-3zrr4n6k.js";import"./chunk-r6p0bd2w.js";import"./chunk-w46g7kdq.js";import"./chunk-bd21p9zz.js";import"./chunk-p54bzjtv.js";import"./chunk-ha1w0xzh.js";import"./chunk-6m9jb0s9.js";import"./chunk-vygkwwjd.js";import"./chunk-twp3mjj0.js";import"./chunk-6pe60dsw.js";import"./chunk-jdx3jshm.js";import"./chunk-6v5867cy.js";import"./chunk-mh19kwzw.js";import"./chunk-7j4qne3q.js";import"./chunk-snqa3zsm.js";import"./chunk-9zm6r55d.js";import"./chunk-vcygx6hs.js";import"./chunk-khzzmyk2.js";import"./chunk-y7hgevfv.js";import"./chunk-47k5jy1p.js";import"./chunk-ab4dq1bn.js";import"./chunk-ph8hn1wt.js";import"./chunk-ptqk1j2r.js";import"./chunk-cqtkxwd8.js";import"./chunk-pr7z5dj8.js";import"./chunk-dnnkq5y4.js";import"./chunk-t239rvej.js";import"./chunk-yz25607t.js";import"./chunk-7hvf9dgx.js";import"./chunk-wkg3c643.js";import"./chunk-fhqfqd5v.js";import"./chunk-cx78hhbx.js";import"./chunk-xv5z1bj6.js";import"./chunk-73r8bjjz.js";import"./chunk-w88ve2pm.js";import"./chunk-ztyy3ga3.js";import"./chunk-mmjgf680.js";import"./chunk-nj1ntakd.js";import"./chunk-cmb62jkt.js";import"./chunk-tkrwcjkr.js";import"./chunk-ztn9e8g1.js";import"./chunk-09geev0j.js";import"./chunk-r5zy4za0.js";import"./chunk-tr6rdr6h.js";import"./chunk-at22twxx.js";import"./chunk-kgptyf7n.js";import"./chunk-j9h1sp4g.js";import"./chunk-p6crzjtf.js";import"./chunk-55fcmswd.js";import"./chunk-qnvsqnz5.js";import"./chunk-pxm4qvqk.js";import"./chunk-j8fcfhr2.js";import{wO as z}from"./chunk-r9w0thdk.js";var J={command:"generate",handler:async()=>{let A=await E.openapi();for(let q of Object.values(A.paths))for(let y of["get","post","put","delete","patch"]){let k=q[y];if(!k?.operationId)continue;k["x-codeSamples"]=[{lang:"js",source:['import { createQitQodeClient } from "@qitqode/sdk"',"","const client = createQitQodeClient()",`await client.${k.operationId}({`," ...","})"].join(`
2
+ import{kg as E}from"./chunk-vp9scf28.js";import"./chunk-kdj7xvz7.js";import"./chunk-0j5rzaxx.js";import"./chunk-36xm6mgm.js";import"./chunk-f0t7rryn.js";import"./chunk-nfg7nt13.js";import"./chunk-450fef7h.js";import"./chunk-yfzyzsr4.js";import"./chunk-v3nqkqhz.js";import"./chunk-w46g7kdq.js";import"./chunk-bd21p9zz.js";import"./chunk-p54bzjtv.js";import"./chunk-ha1w0xzh.js";import"./chunk-6m9jb0s9.js";import"./chunk-vygkwwjd.js";import"./chunk-52frd9p0.js";import"./chunk-xqnzmr7a.js";import"./chunk-r1xh50b2.js";import"./chunk-13rsd5vv.js";import"./chunk-mh19kwzw.js";import"./chunk-a9a0cwmf.js";import"./chunk-nw3e93y8.js";import"./chunk-9zm6r55d.js";import"./chunk-vcygx6hs.js";import"./chunk-khzzmyk2.js";import"./chunk-y7hgevfv.js";import"./chunk-47k5jy1p.js";import"./chunk-kn8w69g9.js";import"./chunk-ph8hn1wt.js";import"./chunk-ptqk1j2r.js";import"./chunk-cqtkxwd8.js";import"./chunk-pr7z5dj8.js";import"./chunk-dnnkq5y4.js";import"./chunk-t239rvej.js";import"./chunk-yz25607t.js";import"./chunk-7hvf9dgx.js";import"./chunk-wkg3c643.js";import"./chunk-fhqfqd5v.js";import"./chunk-2b3fn9xv.js";import"./chunk-rn043d0r.js";import"./chunk-73r8bjjz.js";import"./chunk-t5xxs5kp.js";import"./chunk-ztyy3ga3.js";import"./chunk-mmjgf680.js";import"./chunk-nj1ntakd.js";import"./chunk-cmb62jkt.js";import"./chunk-tkrwcjkr.js";import"./chunk-w2cb8cry.js";import"./chunk-kj8cmn7z.js";import"./chunk-r5zy4za0.js";import"./chunk-tr6rdr6h.js";import"./chunk-at22twxx.js";import"./chunk-kgptyf7n.js";import"./chunk-j9h1sp4g.js";import"./chunk-p6crzjtf.js";import"./chunk-55fcmswd.js";import"./chunk-qnvsqnz5.js";import"./chunk-pxm4qvqk.js";import"./chunk-j8fcfhr2.js";import{wO as z}from"./chunk-r9w0thdk.js";var J={command:"generate",handler:async()=>{let A=await E.openapi();for(let q of Object.values(A.paths))for(let y of["get","post","put","delete","patch"]){let k=q[y];if(!k?.operationId)continue;k["x-codeSamples"]=[{lang:"js",source:['import { createQitQodeClient } from "@qitqode/sdk"',"","const client = createQitQodeClient()",`await client.${k.operationId}({`," ...","})"].join(`
3
3
  `)}]}let F=JSON.stringify(A,null,2),B=await import("./chunk-39z96pc6.js"),C=await import("./chunk-z6sbjvtv.js"),D=await import("./chunk-k1nh5sd2.js"),G=await(B.format??B.default?.format)(F,{parser:"json",plugins:[C.default??C,D.default??D],printWidth:120});await new Promise((q,y)=>{process.stdout.write(G,(k)=>{if(k)y(k);else q()})})}};export{J as GenerateCommand};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{Hk as e}from"./chunk-twp3mjj0.js";import{Hl as r}from"./chunk-jdx3jshm.js";import{lt as o}from"./chunk-kgptyf7n.js";var s=o.object({id:e.zod,type:o.string(),name:o.string(),branch:o.string().nullable(),directory:o.string().nullable(),extra:o.unknown().nullable(),projectID:r.zod});
2
+ import{Hk as e}from"./chunk-52frd9p0.js";import{Hl as r}from"./chunk-r1xh50b2.js";import{lt as o}from"./chunk-kgptyf7n.js";var s=o.object({id:e.zod,type:o.string(),name:o.string(),branch:o.string().nullable(),directory:o.string().nullable(),extra:o.unknown().nullable(),projectID:r.zod});
3
3
  export{s as Mg};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Br as h,Cr as i,Dr as j,Er as k,Fr as l,Hr as m,Ir as n,xr as e,yr as f,zr as g}from"./chunk-w88ve2pm.js";import{Nr as d}from"./chunk-ztyy3ga3.js";import"./chunk-mmjgf680.js";import{ys as c}from"./chunk-09geev0j.js";import"./chunk-r5zy4za0.js";import{Ws as b}from"./chunk-tr6rdr6h.js";import{ft as a}from"./chunk-at22twxx.js";import"./chunk-kgptyf7n.js";import"./chunk-j9h1sp4g.js";import"./chunk-p6crzjtf.js";import"./chunk-55fcmswd.js";import"./chunk-qnvsqnz5.js";import"./chunk-r9w0thdk.js";export{h as getEnvInfo,c as Wildcard,n as Token,m as Rpc,d as Process,b as Log,l as Lock,k as Locale,j as LocalContext,i as Keybind,a as Filesystem,g as EffectUtil,f as Color,e as Archive};
2
+ import{Br as h,Cr as i,Dr as j,Er as k,Fr as l,Hr as m,Ir as n,xr as e,yr as f,zr as g}from"./chunk-t5xxs5kp.js";import{Nr as d}from"./chunk-ztyy3ga3.js";import"./chunk-mmjgf680.js";import{ys as c}from"./chunk-kj8cmn7z.js";import"./chunk-r5zy4za0.js";import{Ws as b}from"./chunk-tr6rdr6h.js";import{ft as a}from"./chunk-at22twxx.js";import"./chunk-kgptyf7n.js";import"./chunk-j9h1sp4g.js";import"./chunk-p6crzjtf.js";import"./chunk-55fcmswd.js";import"./chunk-qnvsqnz5.js";import"./chunk-r9w0thdk.js";export{h as getEnvInfo,c as Wildcard,n as Token,m as Rpc,d as Process,b as Log,l as Lock,k as Locale,j as LocalContext,i as Keybind,a as Filesystem,g as EffectUtil,f as Color,e as Archive};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{gl as a,hl as b,il as c,jl as d,kl as e,ll as f,ml as g,nl as h,ol as i}from"./chunk-6pe60dsw.js";import"./chunk-6v5867cy.js";import"./chunk-9zm6r55d.js";import"./chunk-khzzmyk2.js";import"./chunk-73r8bjjz.js";import"./chunk-w88ve2pm.js";import"./chunk-ztyy3ga3.js";import"./chunk-mmjgf680.js";import"./chunk-09geev0j.js";import"./chunk-r5zy4za0.js";import"./chunk-tr6rdr6h.js";import"./chunk-at22twxx.js";import"./chunk-kgptyf7n.js";import"./chunk-j9h1sp4g.js";import"./chunk-p6crzjtf.js";import"./chunk-55fcmswd.js";import"./chunk-qnvsqnz5.js";import"./chunk-r9w0thdk.js";export{i as stopRefresh,h as startRefresh,g as refresh,d as readModelCatalogResponse,f as get,c as Provider,b as Model,a as MODEL_CATALOG_MAX_BYTES,e as Data};
2
+ import{gl as a,hl as b,il as c,jl as d,kl as e,ll as f,ml as g,nl as h,ol as i}from"./chunk-xqnzmr7a.js";import"./chunk-13rsd5vv.js";import"./chunk-9zm6r55d.js";import"./chunk-khzzmyk2.js";import"./chunk-73r8bjjz.js";import"./chunk-t5xxs5kp.js";import"./chunk-ztyy3ga3.js";import"./chunk-mmjgf680.js";import"./chunk-kj8cmn7z.js";import"./chunk-r5zy4za0.js";import"./chunk-tr6rdr6h.js";import"./chunk-at22twxx.js";import"./chunk-kgptyf7n.js";import"./chunk-j9h1sp4g.js";import"./chunk-p6crzjtf.js";import"./chunk-55fcmswd.js";import"./chunk-qnvsqnz5.js";import"./chunk-r9w0thdk.js";export{i as stopRefresh,h as startRefresh,g as refresh,d as readModelCatalogResponse,f as get,c as Provider,b as Model,a as MODEL_CATALOG_MAX_BYTES,e as Data};
package/bundle/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Tf as eD,Uf as g0}from"./chunk-grnjm8ev.js";import{$f as a0,Wf as s0,Xf as r0,ag as e0}from"./chunk-1rtx2zsc.js";import{dg as Ku}from"./chunk-eg3syjtv.js";import{$r as l0}from"./chunk-7vmx8bg9.js";import{as as d0}from"./chunk-tkrwcjkr.js";import"./chunk-ztn9e8g1.js";import{Cs as y0,ds as Lu,es as o0,fs as k0,gs as hF}from"./chunk-09geev0j.js";import{Hs as GF}from"./chunk-r5zy4za0.js";import"./chunk-tr6rdr6h.js";import"./chunk-at22twxx.js";import"./chunk-kgptyf7n.js";import"./chunk-j9h1sp4g.js";import"./chunk-p6crzjtf.js";import"./chunk-55fcmswd.js";import"./chunk-qnvsqnz5.js";import{sO as v2,tO as p2,wO as p}from"./chunk-r9w0thdk.js";var eF=p2((j3,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 m2,strictEqual as i2}from"assert";var E2={right:f2,center:$2};class XF{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{Tf as eD,Uf as g0}from"./chunk-c55f729m.js";import{$f as a0,Wf as s0,Xf as r0,ag as e0}from"./chunk-41cq88js.js";import{dg as Ku}from"./chunk-eg3syjtv.js";import{$r as l0}from"./chunk-7vmx8bg9.js";import{as as d0}from"./chunk-tkrwcjkr.js";import"./chunk-w2cb8cry.js";import{Cs as y0,ds as Lu,es as o0,fs as k0,gs as hF}from"./chunk-kj8cmn7z.js";import{Hs as GF}from"./chunk-r5zy4za0.js";import"./chunk-tr6rdr6h.js";import"./chunk-at22twxx.js";import"./chunk-kgptyf7n.js";import"./chunk-j9h1sp4g.js";import"./chunk-p6crzjtf.js";import"./chunk-55fcmswd.js";import"./chunk-qnvsqnz5.js";import{sO as v2,tO as p2,wO as p}from"./chunk-r9w0thdk.js";var eF=p2((j3,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 m2,strictEqual as i2}from"assert";var E2={right:f2,center:$2};class XF{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,$)=>{let{width:G}=D[$],J=this.negatePadding(D[$]),Y=f;if(J>JD.stringWidth(f))Y+=" ".repeat(J-JD.stringWidth(f));if(D[$].align&&D[$].align!=="left"&&this.wrap){let Q=E2[D[$].align];if(Y=Q(Y,J),JD.stringWidth(Y)<J)Y+=" ".repeat((G||0)-JD.stringWidth(Y)-1)}let U=D[$].padding||[0,0,0,0];if(U[3])C+=" ".repeat(U[3]);if(C+=ZF(D[$],Y,"| "),C+=Y,C+=ZF(D[$],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
  `;Z.forEach((W)=>{O+=W}),u.fail(O)}};let J={};f.conflicts=function(Q,Z){if(q("<string|object> [array|string]",[Q,Z],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(Z))Z.forEach((O)=>f.conflicts(Q,O));else J[Q].push(Z)}},f.getConflicting=()=>J,f.conflicting=function(Q){if(Object.keys(Q).forEach((Z)=>{if(J[Z])J[Z].forEach((O)=>{if(O&&Q[Z]!==void 0&&Q[O]!==void 0)u.fail(E("Arguments %s and %s are mutually exclusive",Z,O))})}),D.getInternalMethods().getParserConfiguration()["strip-dashed"])Object.keys(J).forEach((Z)=>{J[Z].forEach((O)=>{if(O&&Q[F.Parser.camelCase(Z)]!==void 0&&Q[F.Parser.camelCase(O)]!==void 0)u.fail(E("Arguments %s and %s are mutually exclusive",Z,O))})})},f.recommendCommands=function(Q,Z){Z=Z.sort((A,v)=>v.length-A.length);let W=null,X=1/0;for(let A=0,v;(v=Z[A])!==void 0;A++){let n=O0(Q,v);if(n<=3&&n<X)X=n,W=v}if(W)u.fail(E("Did you mean %s?",W))},f.reset=function(Q){return $=xD($,(Z)=>!Q[Z]),J=xD(J,(Z)=>!Q[Z]),f};let Y=[];return f.freeze=function(){Y.push({implied:$,conflicting:J})},f.unfreeze=function(){let Q=Y.pop();ZD(Q,void 0,F),{implied:$,conflicting:J}=Q},f}var su=[],$u;function hu(D,u,F,E){$u=E;let C={};if(Object.prototype.hasOwnProperty.call(D,"extends")){if(typeof D.extends!=="string")return C;let f=/\.json|\..*rc$/.test(D.extends),$=null;if(!f)try{$=import.meta.resolve(D.extends)}catch(G){return D}else $=Z8(u,D.extends);M8($),su.push($),C=f?JSON.parse($u.readFileSync($,"utf8")):E.require(D.extends),delete D.extends,C=hu(C,$u.path.dirname($),F,$u)}return su=[],F?W0(C,D):Object.assign({},C,D)}function M8(D){if(su.indexOf(D)>-1)throw new DD(`Circular extended configurations: '${D}'.`)}function Z8(D,u){return $u.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,XD,QD,Wu,wD,mD,Uu,WD,Nu,UD,VD,OD,ND,Ru,iD,hD,K,ju,qu,TD,dD,Fu,oD,bD,Hu,P,kD,gD,yD,b,Iu,_D,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"),ru=Symbol("deleteFromParserHintObject"),R0=Symbol("emitWarning"),j0=Symbol("freeze"),q0=Symbol("getDollarZero"),lD=Symbol("getParserConfiguration"),H0=Symbol("getUsageConfiguration"),au=Symbol("guessLocale"),I0=Symbol("guessVersion"),V0=Symbol("parsePositionalNumbers"),eu=Symbol("pkgUp"),tD=Symbol("populateParserHintArray"),Eu=Symbol("populateParserHintSingleValueDictionary"),DF=Symbol("populateParserHintArrayDictionary"),uF=Symbol("populateParserHintDictionary"),FF=Symbol("sanitizeKey"),EF=Symbol("setKey"),CF=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"),BF=Symbol("reset"),Gu=Symbol("runYargsParserAndExecuteCommands"),fF=Symbol("runValidation"),n0=Symbol("setHasOutput"),rD=Symbol("kTrackManuallySetKeys"),X8="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:[]}),XD.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),VD.set(this,{}),OD.set(this,!1),ND.set(this,null),Ru.set(this,!0),iD.set(this,void 0),hD.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),yD.set(this,!1),b.set(this,void 0),Iu.set(this,{}),_D.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 yu(this),"f"),this.$0=this[q0](),this[BF](),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(X8)}addHelpOpt(D,u){if(q("[string|boolean] [string]",[D,u],arguments.length),B(this,ND,"f"))this[ru](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[DF](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[DF](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 $=(f=C.getAliases()[F])!==null&&f!==void 0?f:[],G=[F,...$].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=hu(D,B(this,vD,"f"),this[lD]()["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,XD,"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)gu(D,B(this,P,"f")),B(this,K,"f").defaultDescription[D]=F;if(typeof u==="function"){if(gu(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)=>{ZD(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")ZD(F,!0,B(this,P,"f")),this.demandCommand(D,u,F,F);else if(Array.isArray(D))D.forEach((E)=>{ZD(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[EF](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,XD,"f").getCompletion(D,(C,f)=>{if(C)E(C);else F(f)})});else return B(this,XD,"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,VD,"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(y(u))return u.then(()=>{return B(this,b,"f").help()})}let D=B(this,uD,"f").runDefaultBuilderOn(this);if(y(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,yD,"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,VD,"f")[u];if(B(this,oD,"f")[u])delete B(this,oD,"f")[u];let E={};return B(this,VD,"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[au](),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,_D,"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,XD,"f").setParsed(this.parsed),y(E))return E.then((f)=>{if(B(this,TD,"f"))B(this,TD,"f").call(this,B(this,wD,"f"),f,B(this,hD,"f"));return f}).catch((f)=>{if(B(this,TD,"f"))B(this,TD,"f")(f,this.parsed.argv,B(this,hD,"f"));throw f}).finally(()=>{this[CF](),this.parsed=C});else{if(B(this,TD,"f"))B(this,TD,"f").call(this,B(this,wD,"f"),E,B(this,hD,"f"));this[CF](),this.parsed=C}return E}parseAsync(D,u,F){let E=this.parse(D,u,F);return!y(E)?Promise.resolve(E):E}parseSync(D,u,F){let E=this.parse(D,u,F);if(y(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[eu](u||B(this,vD,"f"));if(E[D]&&typeof E[D]==="object")F=hu(E[D],u||B(this,vD,"f"),this[lD]()["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,$)=>{if(f==="type"&&!["string","number","boolean"].includes($))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 $=C[f];if(Array.isArray($)){if($.indexOf(D)!==-1)u[f]=!0}else if($[D]&&!(f in u))u[f]=$[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,XD,"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(y(F))return F.then(()=>{B(this,b,"f").showHelp(D)}),this}let u=B(this,uD,"f").runDefaultBuilderOn(this);if(y(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,yD,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(ZD(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,_D,"f"))this[ru](B(this,_D,"f")),B(this,b,"f").version(void 0),H(this,_D,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,_D,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,_D,"f")),this.describe(B(this,_D,"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,XD=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,VD=new WeakMap,OD=new WeakMap,ND=new WeakMap,Ru=new WeakMap,iD=new WeakMap,hD=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,yD=new WeakMap,b=new WeakMap,Iu=new WeakMap,_D=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,hD,"f").length)H(this,hD,B(this,hD,"f")+`
79
79
  `,"f");H(this,hD,B(this,hD,"f")+D.join(" "),"f")},error:(...D)=>{if(!this[Vu]())console.error(...D);if(H(this,OD,!0,"f"),B(this,hD,"f").length)H(this,hD,B(this,hD,"f")+`
80
- `,"f");H(this,hD,B(this,hD,"f")+D.join(" "),"f")}}}[ru](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,VD,"f"),strict:B(this,kD,"f"),strictCommands:B(this,gD,"f"),strictOptions:B(this,yD,"f"),completionCommand:B(this,QD,"f"),output:B(this,hD,"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}[lD](){return B(this,qu,"f")}[H0](){return B(this,Iu,"f")}[au](){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[eu]().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}[eu](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,$)=>{if($.includes("package.json"))return"package.json";else return});ZD(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[FF](F),B(this,K,"f")[D].push(F)})}[Eu](D,u,F,E){this[uF](D,u,F,E,(C,f,$)=>{B(this,K,"f")[C][f]=$})}[DF](D,u,F,E){this[uF](D,u,F,E,(C,f,$)=>{B(this,K,"f")[C][f]=(B(this,K,"f")[C][f]||[]).concat($)})}[uF](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[FF](F),E)}[FF](D){if(D==="__proto__")return"___proto___";return D}[EF](D,u){return this[Eu](this[EF].bind(this),"key",D,u),this}[CF](){var D,u,F,E,C,f,$,G,J,Y,U,Q;let Z=B(this,Nu,"f").pop();ZD(Z,void 0,B(this,P,"f"));let O;D=this,u=this,F=this,E=this,C=this,f=this,$=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,VD,W,"f")}}.value,output:{set value(W){H(E,hD,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($,kD,W,"f")}}.value,strictCommands:{set value(W){H(G,gD,W,"f")}}.value,strictOptions:{set value(W){H(J,yD,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}=Z,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[lD].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[BF].bind(this),runValidation:this[fF].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(y(D))return D;if(!u)D=this[U0](D);if(this[lD]()["parse-positional-numbers"]||this[lD]()["parse-positional-numbers"]===void 0)D=this[V0](D);if(E)D=cD(D,this,B(this,UD,"f").getMiddleware(),!1);return D}[BF](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(($)=>{F[$]=!0})}),Object.assign(B(this,oD,"f"),Object.keys(B(this,VD,"f")).reduce((f,$)=>{let G=B(this,VD,"f")[$].filter((J)=>!(J in F));if(G.length>0)f[$]=G;return f},{})),H(this,VD,{},"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(($)=>!F[$])}),C.forEach((f)=>{u[f]=xD(B(this,K,"f")[f],($)=>!F[$])}),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():h0(B(this,b,"f"),B(this,r,"f"),B(this,UD,"f"),B(this,P,"f")),"f"),!B(this,XD,"f"))H(this,XD,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,hD,"","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,$,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[lD]();let U=!!B(this,K,"f").configuration["populate--"],Q=Object.assign({},B(this,K,"f").configuration,{"populate--":!0}),Z=B(this,P,"f").Parser.detailed(D,Object.assign({},B(this,K,"f"),{configuration:{"parse-positional-numbers":!1,...Q}})),O=Object.assign(Z.argv,B(this,dD,"f")),W=void 0,X=Z.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,_D,"f")&&O[n])v=!0}),O.$0=this.$0,this.parsed=Z,E===0)B(this,b,"f").clearCachedHelpMessage();try{if(this[au](),u)return this[sD](O,U,!!F,!1);if(B(this,ND,"f")){if([B(this,ND,"f")].concat(X[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,XD,"f"))===null||f===void 0?void 0:f.completionKey)?[($=B(this,XD,"f"))===null||$===void 0?void 0:$.completionKey,...(J=this.getAliases()[(G=B(this,XD,"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 ID=B(this,uD,"f").runCommand(a,this,Z,ED+1,C,A||v||C);return this[sD](ID,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,Z,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,XD,"f").completionKey}`)+1);return B(this,XD,"f").getCompletion(g,(ED,a)=>{if(ED)throw new DD(ED.message);(a||[]).forEach((ID)=>{B(this,iD,"f").log(ID)}),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(Z.error)throw new DD(Z.error.message);if(!GD){let g=this[fF](X,{},Z.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),y(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)}[fF](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 $=!1;if(B(this,gD,"f"))$=B(this,r,"f").unknownCommands(f);if(B(this,kD,"f")&&!$)B(this,r,"f").unknownArguments(f,D,u,!!E);else if(B(this,yD,"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 J8=c0(ku),v0=J8;import{EOL as HD}from"os";import D2 from"path";import Q8 from"fs";function m0(D=process.env){if(!D.QITQODE_KEY&&D.QORTEX_KEY)D.QITQODE_KEY=D.QORTEX_KEY;if(!D.QLEX_API_KEY&&D.QITQODE_KEY)D.QLEX_API_KEY=D.QITQODE_KEY}m0();var i0=y0("main");l0("main");var RD=du(process.argv),u2=new Set(["--version","-v"]);if(RD.length===1&&u2.has(RD[0]))process.stdout.write(Lu+HD),process.exit();if(RD.length===2&&RD.some((D)=>u2.has(D))&&RD.includes("--verbose")){let D=process.argv[1],u=(()=>{if(!D||D.startsWith("-"))return;if(D.startsWith("/$bunfs/")||/^B:[\\/]~BUN[\\/]/.test(D))return;let E=D2.resolve(D);if(E===process.execPath)return;try{if(!Q8.statSync(E).isFile())return}catch{return}return E})(),F=[`version: ${Lu}`,`channel: ${o0}`,`commit: ${k0}`,`binary: ${process.execPath}`,...u?[`bundle: ${u}`]:[]];process.stdout.write(F.join(HD)+HD),process.exit()}var _u={acp:()=>import("./chunk-v3arcn10.js").then((D)=>D.AcpCommand),mcp:()=>import("./chunk-x65xbskr.js").then((D)=>D.McpCommand),attach:()=>import("./chunk-k2vsezeb.js").then((D)=>D.AttachCommand),run:()=>import("./chunk-jqekpprn.js").then((D)=>D.RunCommand),generate:()=>import("./chunk-ym09zrxe.js").then((D)=>D.GenerateCommand),debug:()=>import("./chunk-3hcr2bzt.js").then((D)=>D.DebugCommand),console:()=>import("./chunk-xpjhe9gz.js").then((D)=>D.ConsoleCommand),providers:()=>import("./chunk-j8nkz81m.js").then((D)=>D.ProvidersCommand),agent:()=>import("./chunk-t6yzrmww.js").then((D)=>D.AgentCommand),upgrade:()=>import("./chunk-ytetprwr.js").then((D)=>D.UpgradeCommand),uninstall:()=>import("./chunk-620dpezx.js").then((D)=>D.UninstallCommand),serve:()=>import("./chunk-rv08wm9j.js").then((D)=>D.ServeCommand),models:()=>import("./chunk-4v2pzx22.js").then((D)=>D.ModelsCommand),stats:()=>import("./chunk-9pmmf4k1.js").then((D)=>D.StatsCommand),usage:()=>import("./chunk-9y03z65a.js").then((D)=>D.UsageCommand),export:()=>import("./chunk-bghqsh7r.js").then((D)=>D.ExportCommand),import:()=>import("./chunk-qnaw8k98.js").then((D)=>D.ImportCommand),github:()=>import("./chunk-1t0c86bz.js").then((D)=>D.GithubCommand),pr:()=>import("./chunk-pdjafjry.js").then((D)=>D.PrCommand),session:()=>import("./chunk-2prf30p3.js").then((D)=>D.SessionCommand),plugin:()=>import("./chunk-7zx1ve4w.js").then((D)=>D.PluginCommand),plug:()=>import("./chunk-7zx1ve4w.js").then((D)=>D.PluginCommand),auth:()=>import("./chunk-58w8c6c2.js").then((D)=>D.AuthCommand),qredits:()=>import("./chunk-b2p54yka.js").then((D)=>D.QreditsCommand),batch:()=>import("./chunk-kqhczjf6.js").then((D)=>D.BatchCommand),db:()=>import("./chunk-dj1jen1p.js").then((D)=>D.DbCommand),default:()=>import("./chunk-25ganjcn.js").then((D)=>D.TuiThreadCommand)};function l(D,u,F){return{command:D,describe:u,aliases:F,handler:async()=>{}}}function $F(){return[l("acp","start ACP (Agent Client Protocol) server"),l("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(r0).options(a0).option("never-ask",{type:"boolean",describe:"start in never-ask mode, auto-decide without asking (permissions excluded)",default:!1}),handler:async()=>{}},l("attach <url>","attach to a running qitqode server"),l("run [message..]","run qitqode with a message"),l("generate","generate files"),l("debug","debugging and troubleshooting tools"),l("console","manage qitqode accounts"),l("providers","manage AI providers and credentials",["auth"]),l("agent","manage agents"),l("upgrade [target]","upgrade qitqode to the latest or a specific version"),l("uninstall","uninstall qitqode and remove all related files"),l("serve","starts a headless qitqode server"),l("models [provider]","list all available models"),l("stats","show token usage and cost statistics"),l("usage [sessionID]","show per-turn token usage and cost"),l("export [sessionID]","export a complete session transcript as JSON or Markdown"),l("import <file>","import session data from JSON file or URL"),l("github","manage GitHub agent"),l("pr <number>","fetch and checkout a GitHub PR branch, then run qitqode"),l("session","manage sessions"),l("plugin <module>","install plugin and update config",["plug"]),l("auth <command>","Sign in or out of Forgewise"),l("qredits <command>","Check Qredits balance and spend history"),l("batch <command>","Submit and poll async batch LLM jobs"),l("db","database tools")]}function zF(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 O8(D){return D.length>0&&D.every((u)=>u==="--help"||u==="-h")}function T8(D){return D.includes("--help")||D.includes("-h")}async function Y8(D){let u=zF(D);if(D.includes("--get-yargs-completions")||u==="completion")return $F();if(O8(D))return $F();else if(u&&u in _u)return[await _u[u]()];else if(T8(D))return $F();else return[await _u.default()]}function F2(D){let u=D.trimStart();if(!u.startsWith("qitqode ")){process.stderr.write(Ku.logo()+HD+HD),process.stderr.write(u);return}process.stderr.write(D)}var Mu=s0(v0(RD)).middleware(async(D)=>{if(D.pure)process.env.QITQODE_PURE="1";let u=await import("./chunk-st0c5wwc.js"),{Filesystem:F}=await import("./chunk-zzznad30.js"),{Heap:E}=await import("./chunk-ak8e1nrf.js"),{Global:C}=await import("./chunk-dvr2b9r1.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-pkn85169.js")).startRefresh(),process.env.AGENT="1",process.env.QITQODE="1",process.env.QITQODE_PID=String(process.pid),u.Default.info("qitqode",{version:Lu,command:zF(RD)??"tui",process_role:i0.processRole,run_id:i0.runID});let $=D2.join(C.Path.data,"qitqode.db");if(!await F.exists($)){let{JsonMigration:G,Database:J}=await import("./chunk-x749e61j.js"),{drizzle:Y}=await import("./chunk-jvkzdap1.js"),U=process.stderr.isTTY;process.stderr.write("Performing one time database migration, may take a few minutes..."+HD);let Q=-1;if(U)process.stderr.write("\x1B[?25l");try{await G.run(Y({client:J.Client().$client}),{progress:(Z)=>{let O=Math.floor(Z.current/Z.total*100);if(O===Q&&Z.current!==Z.total)return;if(Q=O,U){if(process.stderr.write(e0(O,`${Z.label.padEnd(12)} ${Z.current}/${Z.total}`)),Z.current===Z.total)process.stderr.write(`
81
- `)}else process.stderr.write(`sqlite-migration:${O}${HD}`)}})}finally{if(U)process.stderr.write("\x1B[?25h");else process.stderr.write(`sqlite-migration:done${HD}`)}process.stderr.write("Database migration complete."+HD)}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-dypdyrmy.js");await U.run()}catch(U){u.Default.warn("claude-import failed",{e:GF(U)})}},J=zF(RD);if(!J||!(J in _u))G();else await G()}}).usage("").completion("completion","generate shell completion script");for(let D of await Y8(RD))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(F2)}if(u)throw u;process.exit(1)}).strict();try{if(RD.includes("-h")||RD.includes("--help"))await Mu.parse(RD,(D,u,F)=>{if(D)throw D;if(!F)return;F2(F)});else await Mu.parse()}catch(D){let u={};if(D instanceof d0){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-st0c5wwc.js");F.Default.error("fatal",u);let E=g0(D);if(E)Ku.error(E);if(E===void 0)Ku.error("Unexpected error, check log file at "+F.file()+" for more details"+HD),process.stderr.write(GF(D)+HD);process.exitCode=1}finally{process.exit()}
80
+ `,"f");H(this,hD,B(this,hD,"f")+D.join(" "),"f")}}}[ru](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,VD,"f"),strict:B(this,kD,"f"),strictCommands:B(this,gD,"f"),strictOptions:B(this,yD,"f"),completionCommand:B(this,QD,"f"),output:B(this,hD,"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}[lD](){return B(this,qu,"f")}[H0](){return B(this,Iu,"f")}[au](){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[eu]().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}[eu](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,$)=>{if($.includes("package.json"))return"package.json";else return});ZD(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[FF](F),B(this,K,"f")[D].push(F)})}[Eu](D,u,F,E){this[uF](D,u,F,E,(C,f,$)=>{B(this,K,"f")[C][f]=$})}[DF](D,u,F,E){this[uF](D,u,F,E,(C,f,$)=>{B(this,K,"f")[C][f]=(B(this,K,"f")[C][f]||[]).concat($)})}[uF](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[FF](F),E)}[FF](D){if(D==="__proto__")return"___proto___";return D}[EF](D,u){return this[Eu](this[EF].bind(this),"key",D,u),this}[CF](){var D,u,F,E,C,f,$,G,J,Y,U,Q;let Z=B(this,Nu,"f").pop();ZD(Z,void 0,B(this,P,"f"));let O;D=this,u=this,F=this,E=this,C=this,f=this,$=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,VD,W,"f")}}.value,output:{set value(W){H(E,hD,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($,kD,W,"f")}}.value,strictCommands:{set value(W){H(G,gD,W,"f")}}.value,strictOptions:{set value(W){H(J,yD,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}=Z,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[lD].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[BF].bind(this),runValidation:this[fF].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(y(D))return D;if(!u)D=this[U0](D);if(this[lD]()["parse-positional-numbers"]||this[lD]()["parse-positional-numbers"]===void 0)D=this[V0](D);if(E)D=cD(D,this,B(this,UD,"f").getMiddleware(),!1);return D}[BF](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(($)=>{F[$]=!0})}),Object.assign(B(this,oD,"f"),Object.keys(B(this,VD,"f")).reduce((f,$)=>{let G=B(this,VD,"f")[$].filter((J)=>!(J in F));if(G.length>0)f[$]=G;return f},{})),H(this,VD,{},"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(($)=>!F[$])}),C.forEach((f)=>{u[f]=xD(B(this,K,"f")[f],($)=>!F[$])}),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():h0(B(this,b,"f"),B(this,r,"f"),B(this,UD,"f"),B(this,P,"f")),"f"),!B(this,XD,"f"))H(this,XD,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,hD,"","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,$,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[lD]();let U=!!B(this,K,"f").configuration["populate--"],Q=Object.assign({},B(this,K,"f").configuration,{"populate--":!0}),Z=B(this,P,"f").Parser.detailed(D,Object.assign({},B(this,K,"f"),{configuration:{"parse-positional-numbers":!1,...Q}})),O=Object.assign(Z.argv,B(this,dD,"f")),W=void 0,X=Z.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,_D,"f")&&O[n])v=!0}),O.$0=this.$0,this.parsed=Z,E===0)B(this,b,"f").clearCachedHelpMessage();try{if(this[au](),u)return this[sD](O,U,!!F,!1);if(B(this,ND,"f")){if([B(this,ND,"f")].concat(X[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,XD,"f"))===null||f===void 0?void 0:f.completionKey)?[($=B(this,XD,"f"))===null||$===void 0?void 0:$.completionKey,...(J=this.getAliases()[(G=B(this,XD,"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 ID=B(this,uD,"f").runCommand(a,this,Z,ED+1,C,A||v||C);return this[sD](ID,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,Z,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,XD,"f").completionKey}`)+1);return B(this,XD,"f").getCompletion(g,(ED,a)=>{if(ED)throw new DD(ED.message);(a||[]).forEach((ID)=>{B(this,iD,"f").log(ID)}),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(Z.error)throw new DD(Z.error.message);if(!GD){let g=this[fF](X,{},Z.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),y(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)}[fF](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 $=!1;if(B(this,gD,"f"))$=B(this,r,"f").unknownCommands(f);if(B(this,kD,"f")&&!$)B(this,r,"f").unknownArguments(f,D,u,!!E);else if(B(this,yD,"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 J8=c0(ku),v0=J8;import{EOL as HD}from"os";import D2 from"path";import Q8 from"fs";function m0(D=process.env){if(!D.QITQODE_KEY&&D.QORTEX_KEY)D.QITQODE_KEY=D.QORTEX_KEY;if(!D.QLEX_API_KEY&&D.QITQODE_KEY)D.QLEX_API_KEY=D.QITQODE_KEY}m0();var i0=y0("main");l0("main");var RD=du(process.argv),u2=new Set(["--version","-v"]);if(RD.length===1&&u2.has(RD[0]))process.stdout.write(Lu+HD),process.exit();if(RD.length===2&&RD.some((D)=>u2.has(D))&&RD.includes("--verbose")){let D=process.argv[1],u=(()=>{if(!D||D.startsWith("-"))return;if(D.startsWith("/$bunfs/")||/^B:[\\/]~BUN[\\/]/.test(D))return;let E=D2.resolve(D);if(E===process.execPath)return;try{if(!Q8.statSync(E).isFile())return}catch{return}return E})(),F=[`version: ${Lu}`,`channel: ${o0}`,`commit: ${k0}`,`binary: ${process.execPath}`,...u?[`bundle: ${u}`]:[]];process.stdout.write(F.join(HD)+HD),process.exit()}var _u={acp:()=>import("./chunk-fxx0z4yb.js").then((D)=>D.AcpCommand),mcp:()=>import("./chunk-0g7acwt1.js").then((D)=>D.McpCommand),attach:()=>import("./chunk-6sxx56b2.js").then((D)=>D.AttachCommand),run:()=>import("./chunk-xy3c8f1h.js").then((D)=>D.RunCommand),generate:()=>import("./chunk-xynwfaf1.js").then((D)=>D.GenerateCommand),debug:()=>import("./chunk-45k7qm85.js").then((D)=>D.DebugCommand),console:()=>import("./chunk-44723rmb.js").then((D)=>D.ConsoleCommand),providers:()=>import("./chunk-t9pwz4ws.js").then((D)=>D.ProvidersCommand),agent:()=>import("./chunk-bbdp6dj4.js").then((D)=>D.AgentCommand),upgrade:()=>import("./chunk-ty2vg1a5.js").then((D)=>D.UpgradeCommand),uninstall:()=>import("./chunk-np12r26m.js").then((D)=>D.UninstallCommand),serve:()=>import("./chunk-cfjjx3sh.js").then((D)=>D.ServeCommand),models:()=>import("./chunk-03bp59wq.js").then((D)=>D.ModelsCommand),stats:()=>import("./chunk-bch1rj72.js").then((D)=>D.StatsCommand),usage:()=>import("./chunk-g3y5xemb.js").then((D)=>D.UsageCommand),export:()=>import("./chunk-5qsr1q4t.js").then((D)=>D.ExportCommand),import:()=>import("./chunk-dt5aae7t.js").then((D)=>D.ImportCommand),github:()=>import("./chunk-pxv12ctq.js").then((D)=>D.GithubCommand),pr:()=>import("./chunk-eb4y8bjv.js").then((D)=>D.PrCommand),session:()=>import("./chunk-cq9sd32h.js").then((D)=>D.SessionCommand),plugin:()=>import("./chunk-xmb8jy13.js").then((D)=>D.PluginCommand),plug:()=>import("./chunk-xmb8jy13.js").then((D)=>D.PluginCommand),auth:()=>import("./chunk-89b4k585.js").then((D)=>D.AuthCommand),qredits:()=>import("./chunk-xhtcegk0.js").then((D)=>D.QreditsCommand),batch:()=>import("./chunk-jyt2xvha.js").then((D)=>D.BatchCommand),db:()=>import("./chunk-m7v4ky0y.js").then((D)=>D.DbCommand),default:()=>import("./chunk-nymf08b4.js").then((D)=>D.TuiThreadCommand)};function l(D,u,F){return{command:D,describe:u,aliases:F,handler:async()=>{}}}function $F(){return[l("acp","start ACP (Agent Client Protocol) server"),l("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(r0).options(a0).option("never-ask",{type:"boolean",describe:"start in never-ask mode, auto-decide without asking (permissions excluded)",default:!1}),handler:async()=>{}},l("attach <url>","attach to a running qitqode server"),l("run [message..]","run qitqode with a message"),l("generate","generate files"),l("debug","debugging and troubleshooting tools"),l("console","manage qitqode accounts"),l("providers","manage AI providers and credentials",["auth"]),l("agent","manage agents"),l("upgrade [target]","upgrade qitqode to the latest or a specific version"),l("uninstall","uninstall qitqode and remove all related files"),l("serve","starts a headless qitqode server"),l("models [provider]","list all available models"),l("stats","show token usage and cost statistics"),l("usage [sessionID]","show per-turn token usage and cost"),l("export [sessionID]","export a complete session transcript as JSON or Markdown"),l("import <file>","import session data from JSON file or URL"),l("github","manage GitHub agent"),l("pr <number>","fetch and checkout a GitHub PR branch, then run qitqode"),l("session","manage sessions"),l("plugin <module>","install plugin and update config",["plug"]),l("auth <command>","Sign in or out of Forgewise"),l("qredits <command>","Check Qredits balance and spend history"),l("batch <command>","Submit and poll async batch LLM jobs"),l("db","database tools")]}function zF(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 O8(D){return D.length>0&&D.every((u)=>u==="--help"||u==="-h")}function T8(D){return D.includes("--help")||D.includes("-h")}async function Y8(D){let u=zF(D);if(D.includes("--get-yargs-completions")||u==="completion")return $F();if(O8(D))return $F();else if(u&&u in _u)return[await _u[u]()];else if(T8(D))return $F();else return[await _u.default()]}function F2(D){let u=D.trimStart();if(!u.startsWith("qitqode ")){process.stderr.write(Ku.logo()+HD+HD),process.stderr.write(u);return}process.stderr.write(D)}var Mu=s0(v0(RD)).middleware(async(D)=>{if(D.pure)process.env.QITQODE_PURE="1";let u=await import("./chunk-st0c5wwc.js"),{Filesystem:F}=await import("./chunk-yv5aehqq.js"),{Heap:E}=await import("./chunk-h5pnng66.js"),{Global:C}=await import("./chunk-dvr2b9r1.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-zgcabs1k.js")).startRefresh(),process.env.AGENT="1",process.env.QITQODE="1",process.env.QITQODE_PID=String(process.pid),u.Default.info("qitqode",{version:Lu,command:zF(RD)??"tui",process_role:i0.processRole,run_id:i0.runID});let $=D2.join(C.Path.data,"qitqode.db");if(!await F.exists($)){let{JsonMigration:G,Database:J}=await import("./chunk-kxwkab31.js"),{drizzle:Y}=await import("./chunk-jvkzdap1.js"),U=process.stderr.isTTY;process.stderr.write("Performing one time database migration, may take a few minutes..."+HD);let Q=-1;if(U)process.stderr.write("\x1B[?25l");try{await G.run(Y({client:J.Client().$client}),{progress:(Z)=>{let O=Math.floor(Z.current/Z.total*100);if(O===Q&&Z.current!==Z.total)return;if(Q=O,U){if(process.stderr.write(e0(O,`${Z.label.padEnd(12)} ${Z.current}/${Z.total}`)),Z.current===Z.total)process.stderr.write(`
81
+ `)}else process.stderr.write(`sqlite-migration:${O}${HD}`)}})}finally{if(U)process.stderr.write("\x1B[?25h");else process.stderr.write(`sqlite-migration:done${HD}`)}process.stderr.write("Database migration complete."+HD)}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-kf2f3mza.js");await U.run()}catch(U){u.Default.warn("claude-import failed",{e:GF(U)})}},J=zF(RD);if(!J||!(J in _u))G();else await G()}}).usage("").completion("completion","generate shell completion script");for(let D of await Y8(RD))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(F2)}if(u)throw u;process.exit(1)}).strict();try{if(RD.includes("-h")||RD.includes("--help"))await Mu.parse(RD,(D,u,F)=>{if(D)throw D;if(!F)return;F2(F)});else await Mu.parse()}catch(D){let u={};if(D instanceof d0){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-st0c5wwc.js");F.Default.error("fatal",u);let E=g0(D);if(E)Ku.error(E);if(E===void 0)Ku.error("Unexpected error, check log file at "+F.file()+" for more details"+HD),process.stderr.write(GF(D)+HD);process.exitCode=1}finally{process.exit()}
package/bundle/worker.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{fg as V}from"./chunk-5zkj5xv9.js";import{kg as x}from"./chunk-ckb1y6gv.js";import"./chunk-j4ad3mde.js";import"./chunk-kp6gh35c.js";import"./chunk-8q38721t.js";import"./chunk-f0t7rryn.js";import"./chunk-nfg7nt13.js";import"./chunk-450fef7h.js";import"./chunk-3zrr4n6k.js";import{Bh as O,ah as S}from"./chunk-r6p0bd2w.js";import"./chunk-w46g7kdq.js";import"./chunk-bd21p9zz.js";import"./chunk-p54bzjtv.js";import"./chunk-ha1w0xzh.js";import"./chunk-6m9jb0s9.js";import"./chunk-vygkwwjd.js";import{dl as Z,wj as Y}from"./chunk-twp3mjj0.js";import{fl as N}from"./chunk-6pe60dsw.js";import{Nl as q,ql as P}from"./chunk-jdx3jshm.js";import"./chunk-6v5867cy.js";import"./chunk-mh19kwzw.js";import"./chunk-7j4qne3q.js";import"./chunk-snqa3zsm.js";import"./chunk-9zm6r55d.js";import"./chunk-vcygx6hs.js";import"./chunk-khzzmyk2.js";import"./chunk-y7hgevfv.js";import"./chunk-47k5jy1p.js";import"./chunk-ab4dq1bn.js";import"./chunk-ph8hn1wt.js";import"./chunk-ptqk1j2r.js";import"./chunk-cqtkxwd8.js";import"./chunk-pr7z5dj8.js";import"./chunk-dnnkq5y4.js";import"./chunk-t239rvej.js";import"./chunk-yz25607t.js";import"./chunk-7hvf9dgx.js";import"./chunk-wkg3c643.js";import"./chunk-fhqfqd5v.js";import"./chunk-cx78hhbx.js";import"./chunk-xv5z1bj6.js";import"./chunk-73r8bjjz.js";import{Hr as z}from"./chunk-w88ve2pm.js";import"./chunk-ztyy3ga3.js";import"./chunk-mmjgf680.js";import"./chunk-nj1ntakd.js";import"./chunk-cmb62jkt.js";import{$r as C}from"./chunk-7vmx8bg9.js";import"./chunk-tkrwcjkr.js";import"./chunk-ztn9e8g1.js";import{Cs as j,ds as X,gs as G}from"./chunk-09geev0j.js";import"./chunk-r5zy4za0.js";import{Ns as T,Ws as W}from"./chunk-tr6rdr6h.js";import"./chunk-at22twxx.js";import"./chunk-kgptyf7n.js";import"./chunk-j9h1sp4g.js";import"./chunk-p6crzjtf.js";import"./chunk-55fcmswd.js";import"./chunk-qnvsqnz5.js";import"./chunk-pxm4qvqk.js";import"./chunk-j8fcfhr2.js";import"./chunk-r9w0thdk.js";var $=W.create({service:"upgrade"});function k(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=k(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 w}from"v8";j("worker");await W.init({print:process.argv.includes("--print-logs"),dev:N.isLocal(),level:(()=>{if(N.isLocal())return"DEBUG";return"INFO"})()});V.start();C("worker");P.on("event",(D)=>{z.emit("global.event",D)});var U,H={async ping(){return"pong"},async fetch(D){let E={...D.headers},K=L();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 w("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(S),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(H);function L(){let D=T.QITQODE_SERVER_PASSWORD;if(!D)return;let E=T.QITQODE_SERVER_USERNAME??"qitqode";return`Basic ${btoa(`${E}:${D}`)}`}export{H as rpc};
2
+ import{fg as V}from"./chunk-5zkj5xv9.js";import{kg as x}from"./chunk-vp9scf28.js";import"./chunk-kdj7xvz7.js";import"./chunk-0j5rzaxx.js";import"./chunk-36xm6mgm.js";import"./chunk-f0t7rryn.js";import"./chunk-nfg7nt13.js";import"./chunk-450fef7h.js";import"./chunk-yfzyzsr4.js";import{Bh as O,ah as S}from"./chunk-v3nqkqhz.js";import"./chunk-w46g7kdq.js";import"./chunk-bd21p9zz.js";import"./chunk-p54bzjtv.js";import"./chunk-ha1w0xzh.js";import"./chunk-6m9jb0s9.js";import"./chunk-vygkwwjd.js";import{dl as Z,wj as Y}from"./chunk-52frd9p0.js";import{fl as N}from"./chunk-xqnzmr7a.js";import{Nl as q,ql as P}from"./chunk-r1xh50b2.js";import"./chunk-13rsd5vv.js";import"./chunk-mh19kwzw.js";import"./chunk-a9a0cwmf.js";import"./chunk-nw3e93y8.js";import"./chunk-9zm6r55d.js";import"./chunk-vcygx6hs.js";import"./chunk-khzzmyk2.js";import"./chunk-y7hgevfv.js";import"./chunk-47k5jy1p.js";import"./chunk-kn8w69g9.js";import"./chunk-ph8hn1wt.js";import"./chunk-ptqk1j2r.js";import"./chunk-cqtkxwd8.js";import"./chunk-pr7z5dj8.js";import"./chunk-dnnkq5y4.js";import"./chunk-t239rvej.js";import"./chunk-yz25607t.js";import"./chunk-7hvf9dgx.js";import"./chunk-wkg3c643.js";import"./chunk-fhqfqd5v.js";import"./chunk-2b3fn9xv.js";import"./chunk-rn043d0r.js";import"./chunk-73r8bjjz.js";import{Hr as z}from"./chunk-t5xxs5kp.js";import"./chunk-ztyy3ga3.js";import"./chunk-mmjgf680.js";import"./chunk-nj1ntakd.js";import"./chunk-cmb62jkt.js";import{$r as C}from"./chunk-7vmx8bg9.js";import"./chunk-tkrwcjkr.js";import"./chunk-w2cb8cry.js";import{Cs as j,ds as X,gs as G}from"./chunk-kj8cmn7z.js";import"./chunk-r5zy4za0.js";import{Ns as T,Ws as W}from"./chunk-tr6rdr6h.js";import"./chunk-at22twxx.js";import"./chunk-kgptyf7n.js";import"./chunk-j9h1sp4g.js";import"./chunk-p6crzjtf.js";import"./chunk-55fcmswd.js";import"./chunk-qnvsqnz5.js";import"./chunk-pxm4qvqk.js";import"./chunk-j8fcfhr2.js";import"./chunk-r9w0thdk.js";var $=W.create({service:"upgrade"});function k(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=k(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 w}from"v8";j("worker");await W.init({print:process.argv.includes("--print-logs"),dev:N.isLocal(),level:(()=>{if(N.isLocal())return"DEBUG";return"INFO"})()});V.start();C("worker");P.on("event",(D)=>{z.emit("global.event",D)});var U,H={async ping(){return"pong"},async fetch(D){let E={...D.headers},K=L();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 w("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(S),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(H);function L(){let D=T.QITQODE_SERVER_PASSWORD;if(!D)return;let E=T.QITQODE_SERVER_USERNAME??"qitqode";return`Basic ${btoa(`${E}:${D}`)}`}export{H as rpc};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qitqode/qitqode-android-arm64",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
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{cl as a}from"./chunk-twp3mjj0.js";import"./chunk-6pe60dsw.js";import"./chunk-jdx3jshm.js";import"./chunk-6v5867cy.js";import"./chunk-mh19kwzw.js";import"./chunk-7j4qne3q.js";import"./chunk-snqa3zsm.js";import"./chunk-9zm6r55d.js";import"./chunk-vcygx6hs.js";import"./chunk-khzzmyk2.js";import"./chunk-y7hgevfv.js";import"./chunk-47k5jy1p.js";import"./chunk-ab4dq1bn.js";import"./chunk-ph8hn1wt.js";import"./chunk-ptqk1j2r.js";import"./chunk-cqtkxwd8.js";import"./chunk-pr7z5dj8.js";import"./chunk-dnnkq5y4.js";import"./chunk-t239rvej.js";import"./chunk-yz25607t.js";import"./chunk-7hvf9dgx.js";import"./chunk-cx78hhbx.js";import"./chunk-xv5z1bj6.js";import"./chunk-73r8bjjz.js";import"./chunk-w88ve2pm.js";import"./chunk-ztyy3ga3.js";import"./chunk-mmjgf680.js";import"./chunk-nj1ntakd.js";import"./chunk-cmb62jkt.js";import"./chunk-tkrwcjkr.js";import"./chunk-ztn9e8g1.js";import"./chunk-09geev0j.js";import"./chunk-r5zy4za0.js";import"./chunk-tr6rdr6h.js";import"./chunk-at22twxx.js";import"./chunk-kgptyf7n.js";import"./chunk-j9h1sp4g.js";import"./chunk-p6crzjtf.js";import"./chunk-55fcmswd.js";import"./chunk-qnvsqnz5.js";import"./chunk-j8fcfhr2.js";import"./chunk-r9w0thdk.js";export{a as Session};