@qitqode/qitqode-android-arm64 0.2.3 → 0.2.4
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.
- package/bundle/{chunk-0vakk88p.js → chunk-09geev0j.js} +1 -1
- package/bundle/{chunk-qqxrvyx0.js → chunk-1rtx2zsc.js} +1 -1
- package/bundle/{chunk-tza09w2q.js → chunk-1t0c86bz.js} +1 -1
- package/bundle/{chunk-wg55bwqh.js → chunk-25ganjcn.js} +2 -2
- package/bundle/{chunk-96wwns35.js → chunk-2mm37s1w.js} +1 -1
- package/bundle/{chunk-z4kjxtjq.js → chunk-2prf30p3.js} +1 -1
- package/bundle/{chunk-cejyed1j.js → chunk-3hcr2bzt.js} +1 -1
- package/bundle/{chunk-p3rd2q47.js → chunk-3zrr4n6k.js} +1 -1
- package/bundle/{chunk-52w60e1f.js → chunk-4v2pzx22.js} +1 -1
- package/bundle/{chunk-hzrxmdqm.js → chunk-58dpxf8r.js} +1 -1
- package/bundle/{chunk-ha8b2n4x.js → chunk-58w8c6c2.js} +1 -1
- package/bundle/{chunk-jvybgsz5.js → chunk-620dpezx.js} +1 -1
- package/bundle/{chunk-78pt314g.js → chunk-6fc3gw3e.js} +1 -1
- package/bundle/{chunk-6tstcwxp.js → chunk-6pe60dsw.js} +1 -1
- package/bundle/{chunk-fsahzvd5.js → chunk-6v5867cy.js} +1 -1
- package/bundle/{chunk-88q0mtgp.js → chunk-7j4qne3q.js} +1 -1
- package/bundle/{chunk-0nbteyb0.js → chunk-7msfwk15.js} +1 -1
- package/bundle/{chunk-brws2aht.js → chunk-7zx1ve4w.js} +1 -1
- package/bundle/{chunk-msdypt5f.js → chunk-8q38721t.js} +1 -1
- package/bundle/{chunk-7knnz5f1.js → chunk-9pmmf4k1.js} +1 -1
- package/bundle/{chunk-4086z5ys.js → chunk-9y03z65a.js} +1 -1
- package/bundle/{chunk-3atcc483.js → chunk-a3edstpn.js} +1 -1
- package/bundle/{chunk-rp9r3cvt.js → chunk-ab4dq1bn.js} +1 -1
- package/bundle/{chunk-nftgx6bz.js → chunk-aj1sgq1d.js} +1 -1
- package/bundle/{chunk-262s2yz2.js → chunk-ak8e1nrf.js} +1 -1
- package/bundle/{chunk-56v352f8.js → chunk-b034nf8g.js} +1 -1
- package/bundle/{chunk-9fyz4sxa.js → chunk-b2p54yka.js} +1 -1
- package/bundle/{chunk-4websxrs.js → chunk-bghqsh7r.js} +1 -1
- package/bundle/{chunk-qktzz0sy.js → chunk-cdja76vj.js} +1 -1
- package/bundle/{chunk-v6h3nes1.js → chunk-ckb1y6gv.js} +1 -1
- package/bundle/{chunk-xq2kcar4.js → chunk-cx78hhbx.js} +1 -1
- package/bundle/{chunk-n0b0dfqk.js → chunk-d5qgc18n.js} +1 -1
- package/bundle/{chunk-49xhybc2.js → chunk-dj1jen1p.js} +1 -1
- package/bundle/chunk-dwhjgd8j.js +2 -0
- package/bundle/{chunk-a7wmadf1.js → chunk-dypdyrmy.js} +1 -1
- package/bundle/{chunk-yvn8dmah.js → chunk-g26tersc.js} +1 -1
- package/bundle/{chunk-0vxnkstz.js → chunk-grnjm8ev.js} +1 -1
- package/bundle/{chunk-47z3x3dp.js → chunk-hg4039nz.js} +2 -2
- package/bundle/{chunk-565855py.js → chunk-hz3h6e19.js} +1 -1
- package/bundle/{chunk-h823m51m.js → chunk-j4ad3mde.js} +1 -1
- package/bundle/{chunk-p27a88vp.js → chunk-j8nkz81m.js} +1 -1
- package/bundle/{chunk-qqrc1h5b.js → chunk-jdx3jshm.js} +1 -1
- package/bundle/{chunk-z8mj4z6e.js → chunk-jebss7x8.js} +1 -1
- package/bundle/{chunk-16w710kf.js → chunk-jqekpprn.js} +1 -1
- package/bundle/{chunk-65t9b9eq.js → chunk-k2g8346v.js} +1 -1
- package/bundle/{chunk-rscfes01.js → chunk-k2vsezeb.js} +1 -1
- package/bundle/{chunk-4dnntf9k.js → chunk-k6y2vw0d.js} +1 -1
- package/bundle/{chunk-8mm92zn2.js → chunk-kp6gh35c.js} +1 -1
- package/bundle/{chunk-s2gg38y0.js → chunk-kqhczjf6.js} +1 -1
- package/bundle/{chunk-enmsp09e.js → chunk-pdjafjry.js} +1 -1
- package/bundle/{chunk-c74cxhjb.js → chunk-pkn85169.js} +1 -1
- package/bundle/{chunk-nbd13scz.js → chunk-qk9x8j8d.js} +1 -1
- package/bundle/{chunk-zgv1e250.js → chunk-qnaw8k98.js} +1 -1
- package/bundle/{chunk-azpnrnv9.js → chunk-r6p0bd2w.js} +286 -286
- package/bundle/{chunk-nvwzam7a.js → chunk-rv08wm9j.js} +1 -1
- package/bundle/{chunk-bvf2dcq4.js → chunk-snqa3zsm.js} +1 -1
- package/bundle/{chunk-h99tj1e4.js → chunk-t2n7vgsq.js} +1 -1
- package/bundle/{chunk-g06a4chw.js → chunk-t6yzrmww.js} +1 -1
- package/bundle/{chunk-tdyvps17.js → chunk-thrfabyv.js} +1 -1
- package/bundle/{chunk-qznr1emx.js → chunk-twp3mjj0.js} +4 -4
- package/bundle/{chunk-dqp4nmxs.js → chunk-v3arcn10.js} +1 -1
- package/bundle/{chunk-vdxar0ct.js → chunk-w88ve2pm.js} +1 -1
- package/bundle/{chunk-083wpv6r.js → chunk-x65xbskr.js} +1 -1
- package/bundle/{chunk-epgcsjfp.js → chunk-x749e61j.js} +1 -1
- package/bundle/{chunk-0nqf1k20.js → chunk-xpjhe9gz.js} +1 -1
- package/bundle/{chunk-qrxqfp59.js → chunk-xv5z1bj6.js} +1 -1
- package/bundle/{chunk-jrwnz64e.js → chunk-ym09zrxe.js} +1 -1
- package/bundle/{chunk-5bjtq8t2.js → chunk-ytetprwr.js} +1 -1
- package/bundle/chunk-ztn9e8g1.js +2 -0
- package/bundle/{chunk-snbw69t6.js → chunk-zzznad30.js} +1 -1
- package/bundle/index.js +18 -18
- package/bundle/worker.js +1 -1
- package/package.json +1 -1
- package/bundle/chunk-hbyrwmne.js +0 -2
- package/bundle/chunk-x9ptmxt7.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Nd as H,Od as I}from"./chunk-
|
|
2
|
+
import{Nd as H,Od as I}from"./chunk-k6y2vw0d.js";import{ae as G}from"./chunk-5w76kdjr.js";import{Yf as B}from"./chunk-1rtx2zsc.js";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{go 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"./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 f}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 T=G({command:"serve",builder:(b)=>B(b).option("auto-password",{type:"boolean",default:!1,describe:"generate a random ephemeral QITQODE_SERVER_PASSWORD for this run and print it"}),describe:"starts a headless qitqode server",handler:async(b)=>{let A=await H(b);if(b["auto-password"]&&!f.QITQODE_SERVER_PASSWORD){let z=crypto.randomUUID();process.env.QITQODE_SERVER_PASSWORD=z,console.log('Generated ephemeral server password (basic auth, username "qitqode"):'),console.log(` ${z}`)}if(I(A,f.QITQODE_SERVER_PASSWORD))console.error("ERROR: Binding to non-loopback address without QITQODE_SERVER_PASSWORD is not allowed."),console.error("Set QITQODE_SERVER_PASSWORD, pass --auto-password, or pass --no-auth to override (DANGEROUS)."),process.exit(1);if(!f.QITQODE_SERVER_PASSWORD)console.error(""),console.error("\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557"),console.error("\u2551 WARNING: server is running WITHOUT authentication. \u2551"),console.error("\u2551 \u2551"),console.error("\u2551 Any process or browser page that can reach this address can read \u2551"),console.error("\u2551 project files, run shell commands, and open terminals as you. \u2551"),console.error("\u2551 \u2551"),console.error("\u2551 Set QITQODE_SERVER_PASSWORD, or restart with --auto-password to \u2551"),console.error("\u2551 generate an ephemeral password for this run. \u2551"),console.error("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D"),console.error("");if(process.env.QITQODE_KEY)console.log("Using QITQODE_KEY for authentication.");else if(!await D())console.error("Warning: no QitQode credential found. AI features will not work until you sign in (`qitqode auth login`) or set QITQODE_KEY.");let j=await E.listen(A);console.log(`qitqode server listening on http://${j.hostname}:${j.port}`),await new Promise(()=>{}),await j.stop()}});export{T as ServeCommand};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Jn as z2}from"./chunk-9zm6r55d.js";import{Fq as i0,Hq as s0}from"./chunk-
|
|
2
|
+
import{Jn as z2}from"./chunk-9zm6r55d.js";import{Fq as i0,Hq as s0}from"./chunk-xv5z1bj6.js";import{Xr as Q2}from"./chunk-nj1ntakd.js";import{as as E0}from"./chunk-tkrwcjkr.js";import{is as x0}from"./chunk-09geev0j.js";import{Es as t}from"./chunk-r5zy4za0.js";import{Ns as e}from"./chunk-tr6rdr6h.js";import{Xs as $2,bt as f,ft as S,gt as a0,it as o,kt as j0}from"./chunk-at22twxx.js";import{lt as p}from"./chunk-kgptyf7n.js";import{Py as d0}from"./chunk-55fcmswd.js";import{DE as g,Qz as o0,TG as K0,TN as w,YE as c,dK as Z2,eH as J,lB as L,zB as V0}from"./chunk-qnvsqnz5.js";import{sO as W0,uO as e0,wO as L2}from"./chunk-r9w0thdk.js";function z0(Z,Q=!1){let z=Z.length,$=0,X="",Y=0,U=16,G=0,W=0,I=0,H=0,q=0;function R(j,_){let V=0,B=0;while(V<j||!_){let M=Z.charCodeAt($);if(M>=48&&M<=57)B=B*16+M-48;else if(M>=65&&M<=70)B=B*16+M-65+10;else if(M>=97&&M<=102)B=B*16+M-97+10;else break;$++,V++}if(V<j)B=-1;return B}function N(j){$=j,X="",Y=0,U=16,q=0}function A(){let j=$;if(Z.charCodeAt($)===48)$++;else{$++;while($<Z.length&&s(Z.charCodeAt($)))$++}if($<Z.length&&Z.charCodeAt($)===46)if($++,$<Z.length&&s(Z.charCodeAt($))){$++;while($<Z.length&&s(Z.charCodeAt($)))$++}else return q=3,Z.substring(j,$);let _=$;if($<Z.length&&(Z.charCodeAt($)===69||Z.charCodeAt($)===101)){if($++,$<Z.length&&Z.charCodeAt($)===43||Z.charCodeAt($)===45)$++;if($<Z.length&&s(Z.charCodeAt($))){$++;while($<Z.length&&s(Z.charCodeAt($)))$++;_=$}else q=3}return Z.substring(j,_)}function O(){let j="",_=$;while(!0){if($>=z){j+=Z.substring(_,$),q=2;break}let V=Z.charCodeAt($);if(V===34){j+=Z.substring(_,$),$++;break}if(V===92){if(j+=Z.substring(_,$),$++,$>=z){q=2;break}switch(Z.charCodeAt($++)){case 34:j+='"';break;case 92:j+="\\";break;case 47:j+="/";break;case 98:j+="\b";break;case 102:j+="\f";break;case 110:j+=`
|
|
3
3
|
`;break;case 114:j+="\r";break;case 116:j+="\t";break;case 117:let M=R(4,!0);if(M>=0)j+=String.fromCharCode(M);else q=4;break;default:q=5}_=$;continue}if(V>=0&&V<=31)if(Q0(V)){j+=Z.substring(_,$),q=2;break}else q=6;$++}return j}function K(){if(X="",q=0,Y=$,W=G,H=I,$>=z)return Y=z,U=17;let j=Z.charCodeAt($);if(b0(j)){do $++,X+=String.fromCharCode(j),j=Z.charCodeAt($);while(b0(j));return U=15}if(Q0(j)){if($++,X+=String.fromCharCode(j),j===13&&Z.charCodeAt($)===10)$++,X+=`
|
|
4
4
|
`;return G++,I=$,U=14}switch(j){case 123:return $++,U=1;case 125:return $++,U=2;case 91:return $++,U=3;case 93:return $++,U=4;case 58:return $++,U=6;case 44:return $++,U=5;case 34:return $++,X=O(),U=10;case 47:let _=$-1;if(Z.charCodeAt($+1)===47){$+=2;while($<z){if(Q0(Z.charCodeAt($)))break;$++}return X=Z.substring(_,$),U=12}if(Z.charCodeAt($+1)===42){$+=2;let V=z-1,B=!1;while($<V){let M=Z.charCodeAt($);if(M===42&&Z.charCodeAt($+1)===47){$+=2,B=!0;break}if($++,Q0(M)){if(M===13&&Z.charCodeAt($)===10)$++;G++,I=$}}if(!B)$++,q=1;return X=Z.substring(_,$),U=13}return X+=String.fromCharCode(j),$++,U=16;case 45:if(X+=String.fromCharCode(j),$++,$===z||!s(Z.charCodeAt($)))return U=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return X+=A(),U=11;default:while($<z&&y(j))$++,j=Z.charCodeAt($);if(Y!==$){switch(X=Z.substring(Y,$),X){case"true":return U=8;case"false":return U=9;case"null":return U=7}return U=16}return X+=String.fromCharCode(j),$++,U=16}}function y(j){if(b0(j)||Q0(j))return!1;switch(j){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function v(){let j;do j=K();while(j>=12&&j<=15);return j}return{setPosition:N,getPosition:()=>$,scan:Q?v:K,getToken:()=>U,getTokenValue:()=>X,getTokenOffset:()=>Y,getTokenLength:()=>$-Y,getTokenStartLine:()=>W,getTokenStartCharacter:()=>Y-H,getTokenError:()=>q}}function b0(Z){return Z===32||Z===9}function Q0(Z){return Z===10||Z===13}function s(Z){return Z>=48&&Z<=57}var u0;(function(Z){Z[Z.lineFeed=10]="lineFeed",Z[Z.carriageReturn=13]="carriageReturn",Z[Z.space=32]="space",Z[Z._0=48]="_0",Z[Z._1=49]="_1",Z[Z._2=50]="_2",Z[Z._3=51]="_3",Z[Z._4=52]="_4",Z[Z._5=53]="_5",Z[Z._6=54]="_6",Z[Z._7=55]="_7",Z[Z._8=56]="_8",Z[Z._9=57]="_9",Z[Z.a=97]="a",Z[Z.b=98]="b",Z[Z.c=99]="c",Z[Z.d=100]="d",Z[Z.e=101]="e",Z[Z.f=102]="f",Z[Z.g=103]="g",Z[Z.h=104]="h",Z[Z.i=105]="i",Z[Z.j=106]="j",Z[Z.k=107]="k",Z[Z.l=108]="l",Z[Z.m=109]="m",Z[Z.n=110]="n",Z[Z.o=111]="o",Z[Z.p=112]="p",Z[Z.q=113]="q",Z[Z.r=114]="r",Z[Z.s=115]="s",Z[Z.t=116]="t",Z[Z.u=117]="u",Z[Z.v=118]="v",Z[Z.w=119]="w",Z[Z.x=120]="x",Z[Z.y=121]="y",Z[Z.z=122]="z",Z[Z.A=65]="A",Z[Z.B=66]="B",Z[Z.C=67]="C",Z[Z.D=68]="D",Z[Z.E=69]="E",Z[Z.F=70]="F",Z[Z.G=71]="G",Z[Z.H=72]="H",Z[Z.I=73]="I",Z[Z.J=74]="J",Z[Z.K=75]="K",Z[Z.L=76]="L",Z[Z.M=77]="M",Z[Z.N=78]="N",Z[Z.O=79]="O",Z[Z.P=80]="P",Z[Z.Q=81]="Q",Z[Z.R=82]="R",Z[Z.S=83]="S",Z[Z.T=84]="T",Z[Z.U=85]="U",Z[Z.V=86]="V",Z[Z.W=87]="W",Z[Z.X=88]="X",Z[Z.Y=89]="Y",Z[Z.Z=90]="Z",Z[Z.asterisk=42]="asterisk",Z[Z.backslash=92]="backslash",Z[Z.closeBrace=125]="closeBrace",Z[Z.closeBracket=93]="closeBracket",Z[Z.colon=58]="colon",Z[Z.comma=44]="comma",Z[Z.dot=46]="dot",Z[Z.doubleQuote=34]="doubleQuote",Z[Z.minus=45]="minus",Z[Z.openBrace=123]="openBrace",Z[Z.openBracket=91]="openBracket",Z[Z.plus=43]="plus",Z[Z.slash=47]="slash",Z[Z.formFeed=12]="formFeed",Z[Z.tab=9]="tab"})(u0||(u0={}));var x=Array(20).fill(0).map((Z,Q)=>{return" ".repeat(Q)});var L0={" ":{"\n":Array(200).fill(0).map((Z,Q)=>{return`
|
|
5
5
|
`+" ".repeat(Q)}),"\r":Array(200).fill(0).map((Z,Q)=>{return"\r"+" ".repeat(Q)}),"\r\n":Array(200).fill(0).map((Z,Q)=>{return`\r
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{dg as X}from"./chunk-eg3syjtv.js";import{Dg as M,Hg as x}from"./chunk-
|
|
2
|
+
import{dg as X}from"./chunk-eg3syjtv.js";import{Dg as M,Hg as x}from"./chunk-8q38721t.js";import{xj as B}from"./chunk-twp3mjj0.js";import{go as G,ko as C,ro as N,so as V,vo as L}from"./chunk-ab4dq1bn.js";import{eH as z}from"./chunk-qnvsqnz5.js";var Z="forgewise";function A(j){if(!j||j.type!=="api")return"skip";if(j.method==="api-key")return"skip";if(M(j.expiresAt))return"skip";return"probe"}function F(j){if(j===null)return"skipped";if(!j)return"revoked";return"valid"}function U(j){if(!j||j.type!=="api")return{kind:"skip"};if(j.method==="api-key")return{kind:"skip"};if(!M(j.expiresAt))return{kind:"skip"};if(j.refreshToken)return{kind:"refresh-token",refreshToken:j.refreshToken};return{kind:"browser"}}function T(j){if(j==="invalid_grant")return{kind:"revoked"};if(j===null)return{kind:"transient"};return{kind:"persist",credential:L(j,{rotateRefreshToken:!0})}}var b=1e4;function P(j){if(!j)return;if(j.type!=="api")return{type:j.type,expiresAt:0};return{type:j.type,method:j.metadata?.method,expiresAt:Number(j.metadata?.expires_at??0),refreshToken:j.metadata?.refresh_token}}function w(){if(process.platform==="linux")return Boolean(process.env.DISPLAY||process.env.WAYLAND_DISPLAY);return process.platform==="win32"||process.platform==="darwin"}var K=()=>z.gen(function*(){let j=yield*B.Service,D=yield*z.orElseSucceed(j.get(Z),()=>{return});if(A(P(D))==="skip")return"skipped";if(!D||D.type!=="api")return"skipped";let J=yield*z.orElseSucceed(z.tryPromise({try:()=>C(),catch:()=>{return}}).pipe(z.map((Q)=>Q.issuer)),()=>{return});if(!J)return"skipped";let $=yield*z.promise(()=>N(J,D.key)),H=F($);if(H==="revoked")yield*z.orElseSucceed(j.remove(Z),()=>{return});return H}).pipe(z.withSpan("forgewise.validateStoredToken")),W=()=>z.gen(function*(){let j=yield*B.Service,D=yield*z.orElseSucceed(j.get(Z),()=>{return}),J=U(P(D));if(J.kind==="skip")return"skipped";if(J.kind==="refresh-token"){let _=yield*z.promise(()=>V(J.refreshToken).catch(()=>null)),q=T(_);if(q.kind==="revoked")return yield*z.orElseSucceed(j.remove(Z),()=>{return}),"failed";if(q.kind==="persist")return(yield*j.set(Z,q.credential).pipe(z.map(()=>!0),z.catch(()=>z.succeed(!1))))?"ok":"failed"}if(!w())return"skipped";let $=new AbortController,H=setTimeout(()=>$.abort(),b),Q=yield*z.promise(()=>x({signal:$.signal}).catch(()=>null).finally(()=>clearTimeout(H)));if(!Q)return"failed";let Y=L(Q,{rotateRefreshToken:!1});return(yield*j.set(Z,Y).pipe(z.map(()=>!0),z.catch(()=>z.succeed(!1))))?"ok":"failed"}).pipe(z.withSpan("forgewise.refreshIfNeeded"));var E=()=>z.gen(function*(){if((yield*z.promise(()=>G()))?.method!=="sso")return"ok";if((yield*K())==="revoked")return yield*z.sync(()=>X.println(X.Style.TEXT_DANGER+"Your session was revoked (signed out from another device or by an admin action). Run `qitqode auth login` to sign in again."+X.Style.TEXT_NORMAL)),"revoked";if((yield*W())==="failed")yield*z.sync(()=>X.println(X.Style.TEXT_DIM+"(Session refresh failed \u2014 run `qitqode auth login` to re-authenticate)"+X.Style.TEXT_NORMAL));return"ok"});
|
|
3
3
|
export{E as h};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Qd as m,Td as P,Ud as R,Vd as k,Wd as O,Yd as q,Zd as $,_d as I}from"./chunk-ff548b0j.js";import"./chunk-zc0cdvcv.js";import{ae as h}from"./chunk-5w76kdjr.js";import{dg as r}from"./chunk-eg3syjtv.js";import{Bh as L,qh as E}from"./chunk-
|
|
2
|
+
import{Qd as m,Td as P,Ud as R,Vd as k,Wd as O,Yd as q,Zd as $,_d as I}from"./chunk-ff548b0j.js";import"./chunk-zc0cdvcv.js";import{ae as h}from"./chunk-5w76kdjr.js";import{dg as r}from"./chunk-eg3syjtv.js";import{Bh as L,qh as E}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{Ej as N,Tk as x}from"./chunk-twp3mjj0.js";import"./chunk-6pe60dsw.js";import{Nl as i}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"./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{ft as C,kt as j}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{sO as F}from"./chunk-r9w0thdk.js";import u from"path";import U from"fs/promises";var T=F(N(),1);import{EOL as S}from"os";var c=["bash","read","write","edit","glob","grep","webfetch","actor","task"],B=h({command:"create",describe:"create a new agent",builder:(o)=>o.option("path",{type:"string",describe:"directory path to generate the agent file"}).option("description",{type:"string",describe:"what the agent should do"}).option("mode",{type:"string",describe:"agent mode",choices:["all","primary","subagent"]}).option("tools",{type:"string",describe:`comma-separated list of tools to enable (default: all). Available: "${c.join(", ")}"`}).option("model",{type:"string",alias:["m"],describe:"model to use in the format of provider/model"}),async handler(o){await i.provide({directory:process.cwd(),async fn(){let{path:l,description:t,mode:s,tools:p}=o,d=l&&t&&s&&p!==void 0;if(!d)r.empty(),R("Create agent");let D=i.project,g;if(l)g=u.join(l,"agent");else{let e="global";if(D.vcs==="git"){let n=await $({message:"Location",options:[{label:"Current project",value:"project",hint:i.worktree},{label:"Global",value:"global",hint:j.Path.config}]});if(m(n))throw new r.CancelledError;e=n}g=u.join(e==="global"?j.Path.config:u.join(i.worktree,".qitqode"),"agent")}let b;if(t)b=t;else{let e=await I({message:"Description",placeholder:"What should this agent do?",validate:(n)=>n&&n.length>0?void 0:"Required"});if(m(e))throw new r.CancelledError;b=e}let w=q();w.start("Generating agent configuration...");let G=o.model?x.parseModel(o.model):void 0,f=await L.runPromise(E.Service.use((e)=>e.generate({description:b,model:G}))).catch((e)=>{if(w.stop(`LLM failed to generate agent: ${e.message}`,1),d)process.exit(1);throw new r.CancelledError});w.stop(`Agent ${f.identifier} generated`);let y;if(p!==void 0)y=p?p.split(",").map((e)=>e.trim()):c;else{let e=await O({message:"Select tools to enable (Space to toggle)",options:c.map((n)=>({label:n,value:n})),initialValues:c});if(m(e))throw new r.CancelledError;y=e}let v;if(s)v=s;else{let e=await $({message:"Agent mode",options:[{label:"All",value:"all",hint:"Can function in both primary and subagent roles"},{label:"Primary",value:"primary",hint:"Acts as a primary/main agent"},{label:"Subagent",value:"subagent",hint:"Can be used as a subagent by other agents"}],initialValue:"all"});if(m(e))throw new r.CancelledError;v=e}let A={};for(let e of c)if(!y.includes(e))A[e]=!1;let M={description:f.whenToUse,mode:v};if(Object.keys(A).length>0)M.tools=A;let V=T.default.stringify(f.systemPrompt,M),a=u.join(g,`${f.identifier}.md`);if(await U.mkdir(g,{recursive:!0}),await C.exists(a)){if(d)console.error(`Error: Agent file already exists: ${a}`),process.exit(1);throw P.error(`Agent file already exists: ${a}`),new r.CancelledError}if(await C.write(a,V),d)console.log(a);else P.success(`Agent created: ${a}`),k("Done")}})}}),J=h({command:"list",describe:"list all available agents",async handler(){await i.provide({directory:process.cwd(),async fn(){let l=(await L.runPromise(E.Service.use((t)=>t.list()))).sort((t,s)=>{if(t.native!==s.native)return t.native?-1:1;return t.name.localeCompare(s.name)});for(let t of l)process.stdout.write(`${t.name} (${t.mode})`+S),process.stdout.write(` ${JSON.stringify(t.permission,null,2)}`+S)}})}}),ne=h({command:"agent",describe:"manage agents",builder:(o)=>o.command(B).command(J).demandCommand(),async handler(){}});export{ne as AgentCommand};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Bh as F}from"./chunk-
|
|
2
|
+
import{Bh as F}from"./chunk-r6p0bd2w.js";import{cl as Y}from"./chunk-twp3mjj0.js";import{Er as y}from"./chunk-w88ve2pm.js";import{cs as W}from"./chunk-ztn9e8g1.js";import{ft as K}from"./chunk-at22twxx.js";import{eH as x}from"./chunk-qnvsqnz5.js";import{EOL as A}from"os";import B from"path";var z=W.tiers().map((b)=>({label:b.label,providerID:b.providerID,modelID:b.modelID})),$=Object.fromEntries(W.tiers().map((b)=>[`${b.providerID}/${b.modelID}`,b.label]));function w(b){return new Map((b??[]).map((q)=>[q.id,q]))}function j(b,q,C){return(b instanceof Map?b.get(q):Array.isArray(b)?b.find((Q)=>Q.id===q):void 0)?.models[C]}function H(b,q,C){let J=`${q}/${C}`;if($[J])return $[J];return j(b,q,C)?.name??C}function f(b,q){let C=W.tiers().find((J)=>J.providerID===b&&J.modelID===q);return C?W.TIER_RATINGS[C.id]:void 0}async function c(b){return F.runPromise(Y.Service.use((q)=>x.gen(function*(){let C=yield*q.get(b),J=yield*q.messages({sessionID:C.id,agentID:"*"});return{info:C,messages:J}})))}function m(){let b=Y.list({limit:1}).next();return b.done?void 0:b.value}function n(b,q){return`session-${b.slice(0,8)}.${q==="markdown"?"md":"json"}`}function h(b,q){return B.resolve(b,q)}async function o(b,q,C){let J=h(b,q);return await K.write(J,C),J}function G(b,q,C){return C.trim()?`[redacted:${b}:${q}]`:C}function U(b,q,C){if(!C)return C;return Object.keys(C).length?{redacted:`${b}:${q}`}:C}function X(b,q){return{...q,value:G("file-text",b,q.value)}}function N(b,q){return q?.map((C,J)=>({...C,file:G(`${b}-file`,String(J),C.file),patch:G(`${b}-patch`,String(J),C.patch)}))}function E(b){if(!b.source)return b.source;if(b.source.type==="symbol")return{...b.source,path:G("file-path",b.id,b.source.path),name:G("file-symbol",b.id,b.source.name),text:X(b.id,b.source.text)};if(b.source.type==="resource")return{...b.source,clientName:G("file-client",b.id,b.source.clientName),uri:G("file-uri",b.id,b.source.uri),text:X(b.id,b.source.text)};return{...b.source,path:G("file-path",b.id,b.source.path),text:X(b.id,b.source.text)}}function O(b){return{...b,url:G("file-url",b.id,b.url),filename:b.filename===void 0?void 0:G("file-name",b.id,b.filename),source:E(b)}}function L(b){switch(b.type){case"text":return{...b,text:G("text",b.id,b.text),metadata:U("text-metadata",b.id,b.metadata)};case"reasoning":return{...b,text:G("reasoning",b.id,b.text),metadata:U("reasoning-metadata",b.id,b.metadata)};case"file":return O(b);case"subtask":return{...b,prompt:G("subtask-prompt",b.id,b.prompt),description:G("subtask-description",b.id,b.description),command:b.command===void 0?void 0:G("subtask-command",b.id,b.command)};case"tool":return{...b,metadata:U("tool-metadata",b.id,b.metadata),state:b.state.status==="pending"?{...b.state,input:U("tool-input",b.id,b.state.input)??b.state.input,raw:G("tool-raw",b.id,b.state.raw)}:b.state.status==="running"?{...b.state,input:U("tool-input",b.id,b.state.input)??b.state.input,title:b.state.title===void 0?void 0:G("tool-title",b.id,b.state.title),metadata:U("tool-state-metadata",b.id,b.state.metadata)}:b.state.status==="completed"?{...b.state,input:U("tool-input",b.id,b.state.input)??b.state.input,output:G("tool-output",b.id,b.state.output),title:G("tool-title",b.id,b.state.title),metadata:U("tool-state-metadata",b.id,b.state.metadata)??b.state.metadata,attachments:b.state.attachments?.map(O)}:{...b.state,input:U("tool-input",b.id,b.state.input)??b.state.input,error:G("tool-error",b.id,b.state.error),metadata:U("tool-state-metadata",b.id,b.state.metadata)}};case"patch":return{...b,hash:G("patch",b.id,b.hash),files:b.files.map((q,C)=>G("patch-file",`${b.id}-${C}`,q))};case"snapshot":return{...b,snapshot:G("snapshot",b.id,b.snapshot)};case"step-start":case"step-finish":return{...b,snapshot:b.snapshot===void 0?void 0:G("snapshot",b.id,b.snapshot)};case"agent":return{...b,source:!b.source?b.source:{...b.source,value:G("agent-source",b.id,b.source.value)}};default:return b}}function d(b){return{info:{...b.info,title:G("session-title",b.info.id,b.info.title),directory:G("session-directory",b.info.id,b.info.directory),summary:!b.info.summary?b.info.summary:{...b.info.summary,diffs:N("session-diff",b.info.summary.diffs)},revert:!b.info.revert?b.info.revert:{...b.info.revert,snapshot:b.info.revert.snapshot===void 0?void 0:G("revert-snapshot",b.info.id,b.info.revert.snapshot),diff:b.info.revert.diff===void 0?void 0:G("revert-diff",b.info.id,b.info.revert.diff)}},messages:b.messages.map((q)=>({info:q.info.role==="user"?{...q.info,system:q.info.system===void 0?void 0:G("system",q.info.id,q.info.system),summary:!q.info.summary?q.info.summary:{...q.info.summary,title:q.info.summary.title===void 0?void 0:G("summary-title",q.info.id,q.info.summary.title),body:q.info.summary.body===void 0?void 0:G("summary-body",q.info.id,q.info.summary.body),diffs:N("message-diff",q.info.summary.diffs)}}:{...q.info,path:{cwd:G("cwd",q.info.id,q.info.path.cwd),root:G("root",q.info.id,q.info.path.root)}},parts:q.parts.map(L)}))}}function i(b,q,C){let J=w(C.providers),Q=`# ${b.title}
|
|
3
3
|
|
|
4
4
|
`;Q+=`**Session ID:** ${b.id}
|
|
5
5
|
`,Q+=`**Created:** ${new Date(b.time.created).toLocaleString()}
|