@qitqode/qitqode-android-arm64 0.1.27 → 0.1.28
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-exh6cg1r.js → chunk-04h4afhf.js} +1 -1
- package/bundle/{chunk-r1616dce.js → chunk-066eeq5q.js} +1 -1
- package/bundle/{chunk-h7yya9pv.js → chunk-0nj8axbw.js} +2 -2
- package/bundle/{chunk-cpmmvwgw.js → chunk-13hz1kvh.js} +1 -1
- package/bundle/{chunk-r08957sm.js → chunk-1etdhr36.js} +1 -1
- package/bundle/{chunk-dzxzcb2e.js → chunk-1m2e2w1q.js} +1 -1
- package/bundle/{chunk-m2x9xhha.js → chunk-1t6bvbgy.js} +1 -1
- package/bundle/{chunk-k9b1jcqw.js → chunk-24xc0dvv.js} +1 -1
- package/bundle/{chunk-nxbkh4k9.js → chunk-288hw03f.js} +1 -1
- package/bundle/{chunk-kavhpdvb.js → chunk-2abdrqrx.js} +1 -1
- package/bundle/{chunk-0srrmwqs.js → chunk-37s5hwtc.js} +1 -1
- package/bundle/{chunk-vkskqhag.js → chunk-3dvd1bb6.js} +1 -1
- package/bundle/{chunk-14n6rvh2.js → chunk-3fx5jda0.js} +1 -1
- package/bundle/{chunk-brpx707p.js → chunk-3j9hedmx.js} +1 -1
- package/bundle/{chunk-6gz9cthq.js → chunk-457y2816.js} +1 -1
- package/bundle/{chunk-vfdhqf4h.js → chunk-4sk0rmw3.js} +1 -1
- package/bundle/{chunk-zrc54vc4.js → chunk-4yawrap2.js} +1 -1
- package/bundle/{chunk-jg7s9rqz.js → chunk-5g8108nf.js} +1 -1
- package/bundle/{chunk-17psxhve.js → chunk-5syxjhg3.js} +1 -1
- package/bundle/{chunk-wrw22v0a.js → chunk-612f97vv.js} +2 -2
- package/bundle/{chunk-dqed63ek.js → chunk-61zpnwv6.js} +1 -1
- package/bundle/{chunk-55b9699f.js → chunk-8815p61h.js} +1 -1
- package/bundle/{chunk-gsvdt4kq.js → chunk-8tc8x27z.js} +4 -4
- package/bundle/{chunk-0zkejr6k.js → chunk-92d9469t.js} +1 -1
- package/bundle/chunk-a7cxf56j.js +2 -0
- package/bundle/{chunk-b2z0kjss.js → chunk-anjg3mwn.js} +1 -1
- package/bundle/{chunk-02y04bsz.js → chunk-bkbngcvc.js} +1 -1
- package/bundle/{chunk-2wcv3sq5.js → chunk-cmbxrgyx.js} +1 -1
- package/bundle/{chunk-vsjyr170.js → chunk-cwqd48xt.js} +1 -1
- package/bundle/{chunk-8cdm8gh2.js → chunk-cydewa1c.js} +1 -1
- package/bundle/{chunk-jh6yvzee.js → chunk-d7qscj5p.js} +1 -1
- package/bundle/{chunk-47b084yv.js → chunk-dafbntks.js} +2 -2
- package/bundle/{chunk-baet4zev.js → chunk-df6a167w.js} +1 -1
- package/bundle/{chunk-3c7d3dqt.js → chunk-dpkynwgm.js} +1 -1
- package/bundle/{chunk-crx18k6g.js → chunk-e0152ayv.js} +1 -1
- package/bundle/{chunk-fddsgvjy.js → chunk-ebcv65e3.js} +1 -1
- package/bundle/{chunk-zxaaxb99.js → chunk-ebrt1me3.js} +1 -1
- package/bundle/{chunk-4z4p492c.js → chunk-emtebxvs.js} +1 -1
- package/bundle/{chunk-0eqwm9a8.js → chunk-f2tdfry8.js} +1 -1
- package/bundle/{chunk-c0796v8j.js → chunk-fzna6jdj.js} +1 -1
- package/bundle/{chunk-xn2ds2s4.js → chunk-g16zb3y1.js} +1 -1
- package/bundle/{chunk-ksyh6h3a.js → chunk-gj7y56y6.js} +1 -1
- package/bundle/{chunk-c7yy1km8.js → chunk-h602h2gx.js} +1 -1
- package/bundle/{chunk-ak5ngp50.js → chunk-hk698g9e.js} +1 -1
- package/bundle/{chunk-jh3nw7fd.js → chunk-hnb8v476.js} +1 -1
- package/bundle/{chunk-1fja3j80.js → chunk-hxgs0d4t.js} +1 -1
- package/bundle/{chunk-nx90tvwg.js → chunk-jr907144.js} +1 -1
- package/bundle/{chunk-0x3sbyny.js → chunk-jx27xrk1.js} +1 -1
- package/bundle/{chunk-stezw26z.js → chunk-k2tamnfv.js} +1 -1
- package/bundle/{chunk-gbyy8sh5.js → chunk-k3epfxmq.js} +1 -1
- package/bundle/chunk-k5q52wdq.js +2 -0
- package/bundle/{chunk-b7mg883n.js → chunk-k7g3h9tn.js} +1 -1
- package/bundle/{chunk-deae0y1j.js → chunk-kb6w3wbd.js} +1 -1
- package/bundle/{chunk-wajmd3r7.js → chunk-kfsn9c7m.js} +1 -1
- package/bundle/{chunk-dtv1vp0d.js → chunk-krhkrca9.js} +1 -1
- package/bundle/chunk-my7mn79h.js +9 -0
- package/bundle/{chunk-463f9wre.js → chunk-n0mygdfp.js} +1 -1
- package/bundle/{chunk-qt1wffbh.js → chunk-pdzpfkt0.js} +1 -1
- package/bundle/{chunk-cvwa142e.js → chunk-pxtqqmkc.js} +1 -1
- package/bundle/{chunk-qt2c4bty.js → chunk-qc1w4b12.js} +1 -1
- package/bundle/{chunk-jnabd9gn.js → chunk-qvxvc2c2.js} +1 -1
- package/bundle/{chunk-90zd5rss.js → chunk-rmr38x2f.js} +1 -1
- package/bundle/{chunk-ct6dv8st.js → chunk-s1cnzvb2.js} +1 -1
- package/bundle/{chunk-b75gpv0q.js → chunk-scsf8r98.js} +1 -1
- package/bundle/{chunk-j5y10dn6.js → chunk-smt14yjb.js} +1 -1
- package/bundle/{chunk-pget15wc.js → chunk-t22jbw8x.js} +1 -1
- package/bundle/{chunk-9t84mh6t.js → chunk-t2tgz0rc.js} +1 -1
- package/bundle/{chunk-zs2a1f20.js → chunk-w9vh7rhg.js} +1 -1
- package/bundle/{chunk-4k7kbhps.js → chunk-wrfvqp2w.js} +1 -1
- package/bundle/{chunk-njnwdgvd.js → chunk-x1rx6fm7.js} +1 -1
- package/bundle/{chunk-apbgb4h0.js → chunk-x7ers083.js} +1 -1
- package/bundle/{chunk-4ypcf4tg.js → chunk-x9s04nze.js} +1 -1
- package/bundle/{chunk-m2ekhbdp.js → chunk-xvfpzmrf.js} +1 -1
- package/bundle/{chunk-ad46r434.js → chunk-y88xh6w3.js} +2 -2
- package/bundle/{chunk-y9p87bfd.js → chunk-yc1jk3rm.js} +1 -1
- package/bundle/{chunk-j94bdaav.js → chunk-z37aqajx.js} +1 -1
- package/bundle/{chunk-mdck9s88.js → chunk-z6dnv8g5.js} +1 -1
- package/bundle/{chunk-hgxdg1y5.js → chunk-zw0yh3dv.js} +1 -1
- package/bundle/index.js +3 -3
- package/bundle/worker.js +1 -1
- package/package.json +1 -1
- package/bundle/chunk-ew51rwdp.js +0 -9
- package/bundle/chunk-smtvgr3w.js +0 -2
- package/bundle/chunk-yhwx62yf.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ag as i,Bg as j,Cg as k,Dg as l,Eg as m,Fg as n,Gg as o,sg as a,tg as b,ug as c,vg as d,wg as e,xg as f,yg as g,zg as h}from"./chunk-
|
|
2
|
+
import{Ag as i,Bg as j,Cg as k,Dg as l,Eg as m,Fg as n,Gg as o,sg as a,tg as b,ug as c,vg as d,wg as e,xg as f,yg as g,zg as h}from"./chunk-my7mn79h.js";import"./chunk-p68rwmhc.js";import"./chunk-hk698g9e.js";import"./chunk-v965rsr8.js";import"./chunk-m612agnk.js";import"./chunk-q6ztpfcs.js";import"./chunk-jm1ptn8n.js";import"./chunk-24xc0dvv.js";import"./chunk-ebrt1me3.js";import"./chunk-whxjkz9a.js";import"./chunk-89v6dgpp.js";import"./chunk-k309zez0.js";import"./chunk-09kba1hg.js";import"./chunk-t12xrrfr.js";import"./chunk-phxrg7aw.js";import"./chunk-snm5q21k.js";import"./chunk-aztre27e.js";export{k as withRelayedToken,e as resolveDevicePoll,j as refreshAccessToken,i as probeToken,l as loginDevice,n as loginBrowser,m as login,c as isReplitEnv,g as isNearExpiry,d as getConfig,f as getCallbackUri,h as fetchQreditsBalance,o as checkoutApiKey,a as ForgewiseError,b as DeviceFlowUnsupportedError};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{$f as d,Yf as a,Zf as b,_f as c,ag as e}from"./chunk-288hw03f.js";import"./chunk-df6a167w.js";import"./chunk-04h4afhf.js";import"./chunk-my7mn79h.js";import"./chunk-4amgp4yd.js";import"./chunk-nfg7nt13.js";import"./chunk-scnz207s.js";import"./chunk-anjg3mwn.js";import"./chunk-612f97vv.js";import"./chunk-0nj8axbw.js";import"./chunk-p68rwmhc.js";import"./chunk-0a0vat1h.js";import"./chunk-z8v2tsz2.js";import"./chunk-j8efst22.js";import"./chunk-a1pw9r6f.js";import"./chunk-d5bxan80.js";import"./chunk-8tc8x27z.js";import"./chunk-k7g3h9tn.js";import"./chunk-rmr38x2f.js";import"./chunk-5syxjhg3.js";import"./chunk-nj4d554m.js";import"./chunk-1t6bvbgy.js";import"./chunk-cmbxrgyx.js";import"./chunk-a1p2f16h.js";import"./chunk-nt4e3em9.js";import"./chunk-hk698g9e.js";import"./chunk-v965rsr8.js";import"./chunk-1sgby720.js";import"./chunk-5g8108nf.js";import"./chunk-4tbwha3m.js";import"./chunk-m612agnk.js";import"./chunk-yq3m8190.js";import"./chunk-btz9jvec.js";import"./chunk-cqtkxwd8.js";import"./chunk-fkgv2hqd.js";import"./chunk-zyhdxggp.js";import"./chunk-q6ztpfcs.js";import"./chunk-jm1ptn8n.js";import"./chunk-c5e6sk9c.js";import"./chunk-m02zt1a3.js";import"./chunk-vg2fmyje.js";import"./chunk-fzna6jdj.js";import"./chunk-x1rx6fm7.js";import"./chunk-4qqkqrn9.js";import"./chunk-j6emx6jn.js";import"./chunk-be216spx.js";import"./chunk-12bssxd4.js";import"./chunk-24xc0dvv.js";import"./chunk-ebrt1me3.js";import"./chunk-whxjkz9a.js";import"./chunk-89v6dgpp.js";import"./chunk-k309zez0.js";import"./chunk-09kba1hg.js";import"./chunk-t12xrrfr.js";import"./chunk-phxrg7aw.js";import"./chunk-snm5q21k.js";import"./chunk-xpc2zgj7.js";import"./chunk-qjjch1zt.js";import"./chunk-aztre27e.js";export{c as url,b as openapi,d as listen,e as Server,a as Default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{fl as e}from"./chunk-
|
|
2
|
+
import{fl as e}from"./chunk-8tc8x27z.js";import{fm as r}from"./chunk-rmr38x2f.js";import{Uu as o}from"./chunk-k309zez0.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 Lg};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{a,b,c,d,e,f,g}from"./chunk-
|
|
2
|
+
import{a,b,c,d,e,f,g}from"./chunk-1etdhr36.js";import"./chunk-cwqd48xt.js";import"./chunk-c01z3cvg.js";import"./chunk-f2tdfry8.js";import"./chunk-s6bar2f9.js";import"./chunk-jje0srjq.js";import"./chunk-27yxgy03.js";import"./chunk-yajd975f.js";import"./chunk-7ppd2phw.js";import"./chunk-my7mn79h.js";import"./chunk-612f97vv.js";import"./chunk-0nj8axbw.js";import"./chunk-p68rwmhc.js";import"./chunk-0a0vat1h.js";import"./chunk-z8v2tsz2.js";import"./chunk-j8efst22.js";import"./chunk-a1pw9r6f.js";import"./chunk-d5bxan80.js";import"./chunk-8tc8x27z.js";import"./chunk-k7g3h9tn.js";import"./chunk-rmr38x2f.js";import"./chunk-5syxjhg3.js";import"./chunk-nj4d554m.js";import"./chunk-1t6bvbgy.js";import"./chunk-cmbxrgyx.js";import"./chunk-a1p2f16h.js";import"./chunk-nt4e3em9.js";import"./chunk-hk698g9e.js";import"./chunk-v965rsr8.js";import"./chunk-1sgby720.js";import"./chunk-5g8108nf.js";import"./chunk-4tbwha3m.js";import"./chunk-m612agnk.js";import"./chunk-yq3m8190.js";import"./chunk-btz9jvec.js";import"./chunk-cqtkxwd8.js";import"./chunk-fkgv2hqd.js";import"./chunk-zyhdxggp.js";import"./chunk-q6ztpfcs.js";import"./chunk-jm1ptn8n.js";import"./chunk-c5e6sk9c.js";import"./chunk-m02zt1a3.js";import"./chunk-vg2fmyje.js";import"./chunk-fzna6jdj.js";import"./chunk-x1rx6fm7.js";import"./chunk-4qqkqrn9.js";import"./chunk-j6emx6jn.js";import"./chunk-be216spx.js";import"./chunk-12bssxd4.js";import"./chunk-24xc0dvv.js";import"./chunk-ebrt1me3.js";import"./chunk-whxjkz9a.js";import"./chunk-89v6dgpp.js";import"./chunk-k309zez0.js";import"./chunk-09kba1hg.js";import"./chunk-t12xrrfr.js";import"./chunk-phxrg7aw.js";import"./chunk-snm5q21k.js";import"./chunk-xpc2zgj7.js";import"./chunk-qjjch1zt.js";import"./chunk-aztre27e.js";export{f as statusEffect,a as resolveApiKeyFlag,e as logoutEffect,d as loginEffect,c as interactiveLogin,b as apiKeyLoginEffect,g as AuthCommand};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Fp as a0}from"./chunk-a1p2f16h.js";import{ns as f0,ps as l0}from"./chunk-njnwdgvd.js";import{nt as o0}from"./chunk-j6emx6jn.js";import{qt as T0}from"./chunk-12bssxd4.js";import{ku as C0,mu as s,ou as H0,pu as r,yt as P0}from"./chunk-zxaaxb99.js";import{Iu as n0,Ou as f,Su as S,zu as a}from"./chunk-whxjkz9a.js";import{Uu as p}from"./chunk-k309zez0.js";import{wA as u0}from"./chunk-phxrg7aw.js";import{CI as N0,HG as C,PI as J,UC as L,ZD as R0,mG as g,pO as w,wP as s0,xB as p0}from"./chunk-snm5q21k.js";import{$P as X0,bQ as i0,dQ as _2}from"./chunk-aztre27e.js";function h0(Z,Q){let z,$=()=>z??=u0.make(g.provideMerge(Q,f0.layer),{memoMap:l0});return{runSync:(X)=>$().runSync(Z.use(X)),runPromiseExit:(X,Y)=>$().runPromiseExit(Z.use(X),Y),runPromise:(X,Y)=>$().runPromise(Z.use(X),Y),runFork:(X)=>$().runFork(Z.use(X)),runCallback:(X)=>$().runCallback(Z.use(X))}}var Y0={};i0(Y0,{which:()=>w2,sanitize:()=>t0,outdated:()=>K2,layer:()=>e0,install:()=>N2,defaultLayer:()=>Z2,add:()=>F2,Service:()=>z0,Npm:()=>Y0,InstallFailedError:()=>V0});var r0=X0(o0(),1),b0=X0(a0(),1);import k from"path";import I0 from"path";import A2 from"os";import{randomUUID as D2}from"crypto";var B0;((Q0)=>{class Z extends w.TaggedErrorClass()("LockTimeoutError",{key:w.String}){}Q0.LockTimeoutError=Z;class Q extends w.TaggedErrorClass()("LockCompromisedError",{detail:w.String}){}Q0.LockCompromisedError=Q;class z extends w.TaggedErrorClass()("ReleaseError",{detail:w.String,cause:w.optional(w.Defect)}){get message(){return this.detail}}class $ extends w.TaggedErrorClass()("NotAcquired",{}){}let X=60000,Y=300000,U=100,G=2000,W=Math.max(100,Math.floor(X/3)),I=C.exponential(U,1.7).pipe(C.either(C.spaced(G)),C.jittered,C.while((j)=>j.elapsed<Y)),H=w.fromJsonString(w.Struct({token:w.String,pid:w.Number,hostname:w.String,createdAt:w.String})),q=w.decodeUnknownSync(H),R=w.encodeSync(H);class N extends R0.Service()("EffectFlock"){}Q0.Service=N;function A(){return performance.timeOrigin+performance.now()}let O=(j)=>L.getOrElse(j.mtime,()=>new Date(0)).getTime(),K=(j)=>j.reason._tag==="NotFound"||j.reason._tag==="Unknown";Q0.layer=g.effect(N,J.gen(function*(){let j=yield*s.Service,_=yield*f.Service,V=I0.join(j.state,"locks"),B=A2.hostname(),M=new Set,m=(D)=>_.stat(D).pipe(J.catchIf(K,()=>J.void),J.orDie),l=(D)=>_.remove(D,{recursive:!0}).pipe(J.ignore),d=(D)=>_.makeDirectory(D,{mode:448}).pipe(J.as(!0),J.catchIf((T)=>T.reason._tag==="AlreadyExists",()=>J.succeed(!1)),J.orDie),M0=(D,T,E,P)=>_.writeFileString(D,T,{flag:"wx"}).pipe(J.catch(()=>J.gen(function*(){return yield*l(E),yield*new Q({detail:P})}))),w0=J.fnUntraced(function*(D){let T=yield*m(D);if(T&&A()-O(T)>X)yield*l(D);return!1}),Z0=J.fnUntraced(function*(D){if(M.has(D))return;yield*_.makeDirectory(D,{recursive:!0}).pipe(J.orDie),M.add(D)}),F=J.fnUntraced(function*(D,T,E){let P=A(),h=yield*m(T);if(h)return P-O(h)>X;let $0=yield*m(E);if($0)return P-O($0)>X;let q0=yield*m(D);if(!q0)return!1;return P-O(q0)>X}),b=(D,T)=>J.gen(function*(){let E=D2(),P=I0.join(D,"meta.json"),h=I0.join(D,"heartbeat");if(!(yield*d(D))){if(!(yield*F(D,h,P)))return yield*new $;let O0=D+".breaker";if(!(yield*_.makeDirectory(O0,{mode:448}).pipe(J.as(!0),J.catchIf((V2)=>V2.reason._tag==="AlreadyExists",()=>w0(O0)),J.catchIf(K,()=>J.succeed(!1)),J.orDie)))return yield*new $;if(!(yield*J.gen(function*(){if(!(yield*F(D,h,P)))return!1;return yield*l(D),yield*d(D)}).pipe(J.ensuring(l(O0)))))return yield*new $}yield*M0(h,"",D,"heartbeat already existed");let q0=R({token:E,pid:process.pid,hostname:B,createdAt:new Date().toISOString()});return yield*M0(P,q0,D,"meta.json already existed"),{token:E,metaPath:P,heartbeatPath:h,lockDir:D}}).pipe(J.withSpan("EffectFlock.tryAcquire",{attributes:{key:T}})),U0=(D,T)=>b(D,T).pipe(J.retry({while:(E)=>E._tag==="NotAcquired",schedule:I}),J.catchTag("NotAcquired",()=>J.fail(new Z({key:T})))),i=(D)=>J.gen(function*(){let T=yield*_.readFileString(D.metaPath).pipe(J.catch((P)=>{if(K(P))return J.die(new z({detail:"metadata missing"}));return J.die(P)}));if((yield*J.try({try:()=>q(T),catch:(P)=>new z({detail:"metadata invalid",cause:P})}).pipe(J.orDie)).token!==D.token)return yield*J.die(new z({detail:"token mismatch"}));yield*l(D.lockDir)}),k0=J.fn("EffectFlock.acquire")(function*(D,T){let E=T??V;yield*Z0(E);let P=I0.join(E,C0.fast(D)+".lock"),h=yield*J.acquireRelease(U0(P,D),($0)=>i($0));yield*_.utimes(h.heartbeatPath,new Date,new Date).pipe(J.ignore,J.repeat(C.spaced(W)),J.forkScoped)}),B2=p0.dual((D)=>J.isEffect(D[0]),(D,T,E)=>J.scoped(J.gen(function*(){return yield*k0(T,E),yield*D})));return N.of({acquire:k0,withLock:B2})})),Q0.defaultLayer=Q0.layer.pipe(g.provide(f.defaultLayer),g.provide(s.layer))})(B0||={});class V0 extends w.TaggedErrorClass()("NpmInstallFailedError",{add:w.Array(w.String).pipe(w.optional),dir:w.String,cause:w.optional(w.Defect)}){}class z0 extends R0.Service()("@qitqode/Npm"){}var c0=process.platform==="win32"?new Set(["<",">",":",'"',"|","?","*"]):void 0;function t0(Z){if(!c0)return Z;return Array.from(Z,(Q)=>c0.has(Q)||Q.charCodeAt(0)<32?"_":Q).join("")}var d0=(Z,Q)=>{let z;try{let $=typeof Bun<"u"?import.meta.resolve(Z,Q):import.meta.resolve(Q);z=L.some($)}catch{z=L.none()}return{directory:Q,entrypoint:z}},e0=g.effect(z0,J.gen(function*(){let Z=yield*f.Service,Q=yield*s.Service,z=yield*s0.FileSystem,$=yield*B0.Service,X=(H)=>k.join(Q.cache,"packages",t0(H)),Y=(H)=>J.gen(function*(){yield*$.acquire(`npm-install:${H.dir}`);let{Arborist:q}=yield*J.promise(()=>import("./chunk-yp0a8q29.js").then((m)=>X0(m.default,1))),R=new q({path:H.dir,binLinks:!0,progress:!1,savePrefix:"",ignoreScripts:!0});return yield*J.tryPromise({try:()=>R.reify({add:H?.add||[],save:!0,saveType:"prod"}),catch:(N)=>new V0({cause:N,add:H?.add,dir:H.dir})})}).pipe(J.withSpan("Npm.reify",{attributes:H})),U=J.fn("Npm.outdated")(function*(H,q){let R=yield*J.tryPromise({try:()=>fetch(`https://registry.npmjs.org/${H}`),catch:()=>{return}}).pipe(J.orElseSucceed(()=>{return}));if(!R||!R.ok)return!1;let A=(yield*J.tryPromise({try:()=>R.json(),catch:()=>{return}}).pipe(J.orElseSucceed(()=>{return})))?.["dist-tags"]?.latest;if(!A)return!1;if(/[\s^~*xX<>|=]/.test(q))return!b0.default.satisfies(A,q);return b0.default.lt(q,A)}),G=J.fn("Npm.add")(function*(H){let q=X(H),R=(()=>{try{return r0.default(H).name??H}catch{return H}})();if(yield*Z.existsSafe(q))return d0(R,k.join(q,"node_modules",R));let A=(yield*Y({dir:q,add:[H]})).edgesOut.values().next().value?.to;if(!A)return yield*new V0({add:[H],dir:q});return d0(A.name,A.path)},J.scoped),W=J.fn("Npm.install")(function*(H,q){if(!(yield*Z.access(H,{writable:!0}).pipe(J.as(!0),J.orElseSucceed(()=>!1))))return;let N=q?.add.map((A)=>[A.name,A.version].filter(Boolean).join("@"))??[];if(yield*J.gen(function*(){if(!(yield*Z.existsSafe(k.join(H,"node_modules"))))return yield*Y({add:N,dir:H}),!0;return!1}).pipe(J.withSpan("Npm.checkNodeModules")))return;yield*J.gen(function*(){let A=yield*Z.readJson(k.join(H,"package.json")).pipe(J.orElseSucceed(()=>({}))),O=yield*Z.readJson(k.join(H,"package-lock.json")).pipe(J.orElseSucceed(()=>({}))),K=A,y=O,v=new Set([...Object.keys(K?.dependencies||{}),...Object.keys(K?.devDependencies||{}),...Object.keys(K?.peerDependencies||{}),...Object.keys(K?.optionalDependencies||{}),...(q?.add||[]).map((V)=>V.name)]),j=y?.packages?.[""]||{},_=new Set([...Object.keys(j?.dependencies||{}),...Object.keys(j?.devDependencies||{}),...Object.keys(j?.peerDependencies||{}),...Object.keys(j?.optionalDependencies||{})]);for(let V of v)if(!_.has(V)){yield*Y({dir:H,add:N});return}}).pipe(J.withSpan("Npm.checkDirty"));return},J.scoped),I=J.fn("Npm.which")(function*(H){let q=X(H),R=k.join(q,"node_modules",".bin"),N=J.fnUntraced(function*(){let A=yield*z.readDirectory(R).pipe(J.catch(()=>J.succeed([])));if(A.length===0)return L.none();if(A.length===1)return L.some(A[0]);let O=yield*Z.readJson(k.join(q,"node_modules",H,"package.json")).pipe(J.option);if(L.isSome(O)){let K=O.value;if(K?.bin){let y=H.startsWith("@")?H.split("/")[1]:H,v=K.bin;if(typeof v==="string")return L.some(y);let j=Object.keys(v);if(j.length===1)return L.some(j[0]);return v[y]?L.some(y):L.some(j[0])}}return L.some(A[0])});return yield*J.gen(function*(){let A=yield*N();if(L.isSome(A))return L.some(k.join(R,A.value));yield*z.remove(k.join(q,"package-lock.json")).pipe(J.orElseSucceed(()=>{})),yield*G(H);let O=yield*N();if(L.isNone(O))return L.none();return L.some(k.join(R,O.value))}).pipe(J.scoped,J.orElseSucceed(()=>L.none()))});return z0.of({add:G,install:W,outdated:U,which:I})})),Z2=e0.pipe(g.provide(B0.layer),g.provide(f.layer),g.provide(s.layer),g.provide(n0.layer)),{runPromise:A0}=h0(z0,Z2);async function N2(...Z){return A0((Q)=>Q.install(...Z))}async function F2(...Z){let Q=await A0((z)=>z.add(...Z));return{directory:Q.directory,entrypoint:L.getOrUndefined(Q.entrypoint)}}async function K2(...Z){return A0((Q)=>Q.outdated(...Z))}async function w2(...Z){let Q=await A0((z)=>z.which(...Z));return L.getOrUndefined(Q)}var Q2=X0(o0(),1),D0=X0(a0(),1);import u from"path";import{fileURLToPath as _0,pathToFileURL as n}from"url";var O2=["opencode-openai-codex-auth","opencode-copilot-auth"];function _Z(Z){return O2.some((Q)=>Z.includes(Q))}function z2(Z){try{return Q2.default(Z)}catch{}}function NZ(Z){let Q=z2(Z);if(Q?.type==="alias"&&!Q.name){let z=Q.subSpec;if(z?.name){let $=!z.rawSpec||z.rawSpec==="*"?"latest":z.rawSpec;return{pkg:z.name,version:$}}}if(!Q?.name)return{pkg:Z,version:""};if(Q.raw===Q.name)return{pkg:Q.name,version:"latest"};return{pkg:Q.name,version:Q.rawSpec}}var b2=["index.ts","index.tsx","index.js","index.mjs","index.cjs"];function X2(Z){if(J2(Z))return"file";return"npm"}function L2(Z,Q){if(Z.startsWith("file://"))return _0(Z);if(u.isAbsolute(Z))return Z;return u.resolve(Q,Z)}function Y2(Z){return u.isAbsolute(Z)||/^[A-Za-z]:[\\/]/.test(Z)}function T2(Z){if(typeof Z==="string")return Z;if(!a(Z))return;for(let Q of["import","default"]){let z=Z[Q];if(typeof z==="string")return z}return}function y2(Z){let Q=Z.json.main;if(typeof Q!=="string")return;let z=Q.trim();if(!z)return;return z}function H2(Z,Q,z,$){let X=L2(Q,$.dir),Y=S.resolve($.dir),U=S.resolve(X);if(!S.contains(Y,U))throw Error(`Plugin ${Z} resolved ${z} entry outside plugin directory`);return U}function $2(Z,Q,z,$){return n(H2(Z,Q,z,$)).href}function P2(Z,Q,z){let $=z.json.exports;if(a($)){let Y=T2($[`./${Q}`]);if(Y)return $2(Z,Y,Q,z)}if(Q!=="server")return;let X=y2(z);if(!X)return;return $2(Z,X,Q,z)}function S2(Z){if(Z.startsWith("file://"))return _0(Z);if(u.isAbsolute(Z))return Z}async function L0(Z){for(let Q of b2){let z=u.join(Z,Q);if(await S.exists(z))return z}}async function m2(Z){let Q=S2(Z);if(!Q)return;if(!(await S.statAsync(Q))?.isDirectory())return;return Q}async function E2(Z,Q,z,$){let X=X2(Z),Y=$??(X==="npm"?await o(Q):await o(Q).catch(()=>{return}));if(!Y)return Q;let U=P2(Z,z,Y);if(U)return U;let G=await m2(Q);if(z==="tui"){if(X==="file"&&G){let W=await L0(G);if(W)return n(W).href}if(X==="npm")return;if(G)return;return Q}if(G&&a(Y.json.exports)){if(X==="file"){let W=await L0(G);if(W)return n(W).href}return}return Q}function J2(Z){return Z.startsWith("file://")||Z.startsWith(".")||Y2(Z)}async function v2(Z){let Q=Z.startsWith("file://")?_0(Z):Z,z=u.isAbsolute(Q)||/^[A-Za-z]:[\\/]/.test(Q)?Q:u.resolve(Q);if(!(await S.statAsync(z))?.isDirectory()){if(Z.startsWith("file://"))return Z;return n(z).href}if(await S.exists(u.join(z,"package.json")))return n(z).href;let X=await L0(z);if(X)return n(X).href;throw Error(`Plugin directory ${z} is missing package.json or index file`)}async function FZ(Z,Q,z){if(!D0.default.valid(Q)||D0.default.major(Q)===0)return;let $=z??await o(Z).catch(()=>{return});if(!$)return;let X=$.json.engines;if(!a(X))return;let Y=X.qitqode??X.opencode;if(typeof Y!=="string")return;if(!D0.default.satisfies(Q,Y))throw Error(`Plugin requires qitqode ${Y} but running ${Q}`)}async function KZ(Z){if(J2(Z))return v2(Z);let Q=z2(Z),z=Q?.name&&Q.raw===Q.name?`${Q.name}@latest`:Z;return(await Y0.add(z)).directory}async function o(Z){let Q=Z.startsWith("file://")?_0(Z):Z,$=(await S.statAsync(Q))?.isDirectory()?Q:u.dirname(Q),X=u.join($,"package.json"),Y=await S.readJson(X);return{dir:$,pkg:X,json:Y}}async function wZ(Z,Q,z){let $=X2(Z),X=$==="npm"?await o(Q):await o(Q).catch(()=>{return}),Y=await E2(Z,Q,z,X);return{spec:Z,source:$,target:Q,pkg:X,entry:Y}}function OZ(Z,Q){let z=Q.json["oc-themes"];if(z===void 0)return[];if(!Array.isArray(z))throw TypeError(`Plugin ${Z} has invalid oc-themes field`);let $=z.map((X)=>{if(typeof X!=="string")throw TypeError(`Plugin ${Z} has invalid oc-themes entry`);let Y=X.trim();if(!Y)throw TypeError(`Plugin ${Z} has empty oc-themes entry`);if(Y.startsWith("file://")||Y2(Y))throw TypeError(`Plugin ${Z} oc-themes entry must be relative: ${X}`);return H2(Z,Y,"oc-themes",Q)});return Array.from(new Set($))}function bZ(Z,Q){if(Z===void 0)return;if(typeof Z!=="string")throw TypeError(`Plugin ${Q} has invalid id type ${typeof Z}`);let z=Z.trim();if(!z)throw TypeError(`Plugin ${Q} has an empty id`);return z}function LZ(Z,Q,z,$="strict"){let X=Z.default;if(!a(X)){if($==="detect")return;throw TypeError(`Plugin ${Q} must default export an object with ${z}()`)}if($==="detect"&&!("id"in X)&&!("server"in X)&&!("tui"in X))return;let Y="server"in X?X.server:void 0,U="tui"in X?X.tui:void 0;if(Y!==void 0&&typeof Y!=="function")throw TypeError(`Plugin ${Q} has invalid server export`);if(U!==void 0&&typeof U!=="function")throw TypeError(`Plugin ${Q} has invalid tui export`);if(Y!==void 0&&U!==void 0)throw TypeError(`Plugin ${Q} must default export either server() or tui(), not both`);if(z==="server"&&Y===void 0)throw TypeError(`Plugin ${Q} must default export an object with server()`);if(z==="tui"&&U===void 0)throw TypeError(`Plugin ${Q} must default export an object with tui()`);return X}async function TZ(Z,Q,z,$,X){if(Z==="file"){if($)return $;throw TypeError(`Path plugin ${Q} must export id`)}if($)return $;let Y=X??await o(z);if(typeof Y.json.name!=="string"||!Y.json.name.trim())throw TypeError(`Plugin package ${Y.pkg} is missing name`);return Y.json.name.trim()}var S0={};i0(S0,{readFile:()=>l2,files:()=>g2,fileInDirectory:()=>f2,directories:()=>k2,claudeCommandDirectories:()=>u2,ConfigPaths:()=>S0});import y0 from"path";var W2=T0.create("ConfigJsonError",p.object({path:p.string(),message:p.string().optional()})),mZ=T0.create("ConfigInvalidError",p.object({path:p.string(),issues:p.custom().optional(),message:p.string().optional()}));var g2=N0("ConfigPaths.projectFiles")(function*(Z,Q,z){return(yield*(yield*f.Service).up({targets:[`${Z}.jsonc`,`${Z}.json`],start:Q,stop:z})).toReversed()}),k2=N0("ConfigPaths.directories")(function*(Z,Q){let z=yield*f.Service;return P0([H0.Path.config,...!r.QITQODE_DISABLE_PROJECT_CONFIG?yield*z.up({targets:[".qitqode"],start:Z,stop:Q}):[],...yield*z.up({targets:[".qitqode"],start:H0.Path.home,stop:H0.Path.home}),...r.QITQODE_CONFIG_DIR?[r.QITQODE_CONFIG_DIR]:[]])}),u2=N0("ConfigPaths.claudeCommandDirectories")(function*(Z,Q){if(r.QITQODE_DISABLE_CLAUDE_CODE_COMMANDS)return[];let z=yield*f.Service;return P0([y0.join(H0.Path.home,".claude"),...!r.QITQODE_DISABLE_PROJECT_CONFIG?yield*z.up({targets:[".claude"],start:Z,stop:Q}):[]])});function f2(Z,Q){return[y0.join(Z,`${Q}.json`),y0.join(Z,`${Q}.jsonc`)]}async function l2(Z){return S.readText(Z).catch((Q)=>{if(Q.code==="ENOENT")return;throw new W2({path:Z},{cause:Q})})}function W0(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&&t(Z.charCodeAt($)))$++}if($<Z.length&&Z.charCodeAt($)===46)if($++,$<Z.length&&t(Z.charCodeAt($))){$++;while($<Z.length&&t(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&&t(Z.charCodeAt($))){$++;while($<Z.length&&t(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+=`
|
|
2
|
+
import{Fp as a0}from"./chunk-a1p2f16h.js";import{ns as f0,ps as l0}from"./chunk-x1rx6fm7.js";import{nt as o0}from"./chunk-j6emx6jn.js";import{qt as T0}from"./chunk-12bssxd4.js";import{ku as C0,mu as s,ou as H0,pu as r,yt as P0}from"./chunk-ebrt1me3.js";import{Iu as n0,Ou as f,Su as S,zu as a}from"./chunk-whxjkz9a.js";import{Uu as p}from"./chunk-k309zez0.js";import{wA as u0}from"./chunk-phxrg7aw.js";import{CI as N0,HG as C,PI as J,UC as L,ZD as R0,mG as g,pO as w,wP as s0,xB as p0}from"./chunk-snm5q21k.js";import{$P as X0,bQ as i0,dQ as _2}from"./chunk-aztre27e.js";function h0(Z,Q){let z,$=()=>z??=u0.make(g.provideMerge(Q,f0.layer),{memoMap:l0});return{runSync:(X)=>$().runSync(Z.use(X)),runPromiseExit:(X,Y)=>$().runPromiseExit(Z.use(X),Y),runPromise:(X,Y)=>$().runPromise(Z.use(X),Y),runFork:(X)=>$().runFork(Z.use(X)),runCallback:(X)=>$().runCallback(Z.use(X))}}var Y0={};i0(Y0,{which:()=>w2,sanitize:()=>t0,outdated:()=>K2,layer:()=>e0,install:()=>N2,defaultLayer:()=>Z2,add:()=>F2,Service:()=>z0,Npm:()=>Y0,InstallFailedError:()=>V0});var r0=X0(o0(),1),b0=X0(a0(),1);import k from"path";import I0 from"path";import A2 from"os";import{randomUUID as D2}from"crypto";var B0;((Q0)=>{class Z extends w.TaggedErrorClass()("LockTimeoutError",{key:w.String}){}Q0.LockTimeoutError=Z;class Q extends w.TaggedErrorClass()("LockCompromisedError",{detail:w.String}){}Q0.LockCompromisedError=Q;class z extends w.TaggedErrorClass()("ReleaseError",{detail:w.String,cause:w.optional(w.Defect)}){get message(){return this.detail}}class $ extends w.TaggedErrorClass()("NotAcquired",{}){}let X=60000,Y=300000,U=100,G=2000,W=Math.max(100,Math.floor(X/3)),I=C.exponential(U,1.7).pipe(C.either(C.spaced(G)),C.jittered,C.while((j)=>j.elapsed<Y)),H=w.fromJsonString(w.Struct({token:w.String,pid:w.Number,hostname:w.String,createdAt:w.String})),q=w.decodeUnknownSync(H),R=w.encodeSync(H);class N extends R0.Service()("EffectFlock"){}Q0.Service=N;function A(){return performance.timeOrigin+performance.now()}let O=(j)=>L.getOrElse(j.mtime,()=>new Date(0)).getTime(),K=(j)=>j.reason._tag==="NotFound"||j.reason._tag==="Unknown";Q0.layer=g.effect(N,J.gen(function*(){let j=yield*s.Service,_=yield*f.Service,V=I0.join(j.state,"locks"),B=A2.hostname(),M=new Set,m=(D)=>_.stat(D).pipe(J.catchIf(K,()=>J.void),J.orDie),l=(D)=>_.remove(D,{recursive:!0}).pipe(J.ignore),d=(D)=>_.makeDirectory(D,{mode:448}).pipe(J.as(!0),J.catchIf((T)=>T.reason._tag==="AlreadyExists",()=>J.succeed(!1)),J.orDie),M0=(D,T,E,P)=>_.writeFileString(D,T,{flag:"wx"}).pipe(J.catch(()=>J.gen(function*(){return yield*l(E),yield*new Q({detail:P})}))),w0=J.fnUntraced(function*(D){let T=yield*m(D);if(T&&A()-O(T)>X)yield*l(D);return!1}),Z0=J.fnUntraced(function*(D){if(M.has(D))return;yield*_.makeDirectory(D,{recursive:!0}).pipe(J.orDie),M.add(D)}),F=J.fnUntraced(function*(D,T,E){let P=A(),h=yield*m(T);if(h)return P-O(h)>X;let $0=yield*m(E);if($0)return P-O($0)>X;let q0=yield*m(D);if(!q0)return!1;return P-O(q0)>X}),b=(D,T)=>J.gen(function*(){let E=D2(),P=I0.join(D,"meta.json"),h=I0.join(D,"heartbeat");if(!(yield*d(D))){if(!(yield*F(D,h,P)))return yield*new $;let O0=D+".breaker";if(!(yield*_.makeDirectory(O0,{mode:448}).pipe(J.as(!0),J.catchIf((V2)=>V2.reason._tag==="AlreadyExists",()=>w0(O0)),J.catchIf(K,()=>J.succeed(!1)),J.orDie)))return yield*new $;if(!(yield*J.gen(function*(){if(!(yield*F(D,h,P)))return!1;return yield*l(D),yield*d(D)}).pipe(J.ensuring(l(O0)))))return yield*new $}yield*M0(h,"",D,"heartbeat already existed");let q0=R({token:E,pid:process.pid,hostname:B,createdAt:new Date().toISOString()});return yield*M0(P,q0,D,"meta.json already existed"),{token:E,metaPath:P,heartbeatPath:h,lockDir:D}}).pipe(J.withSpan("EffectFlock.tryAcquire",{attributes:{key:T}})),U0=(D,T)=>b(D,T).pipe(J.retry({while:(E)=>E._tag==="NotAcquired",schedule:I}),J.catchTag("NotAcquired",()=>J.fail(new Z({key:T})))),i=(D)=>J.gen(function*(){let T=yield*_.readFileString(D.metaPath).pipe(J.catch((P)=>{if(K(P))return J.die(new z({detail:"metadata missing"}));return J.die(P)}));if((yield*J.try({try:()=>q(T),catch:(P)=>new z({detail:"metadata invalid",cause:P})}).pipe(J.orDie)).token!==D.token)return yield*J.die(new z({detail:"token mismatch"}));yield*l(D.lockDir)}),k0=J.fn("EffectFlock.acquire")(function*(D,T){let E=T??V;yield*Z0(E);let P=I0.join(E,C0.fast(D)+".lock"),h=yield*J.acquireRelease(U0(P,D),($0)=>i($0));yield*_.utimes(h.heartbeatPath,new Date,new Date).pipe(J.ignore,J.repeat(C.spaced(W)),J.forkScoped)}),B2=p0.dual((D)=>J.isEffect(D[0]),(D,T,E)=>J.scoped(J.gen(function*(){return yield*k0(T,E),yield*D})));return N.of({acquire:k0,withLock:B2})})),Q0.defaultLayer=Q0.layer.pipe(g.provide(f.defaultLayer),g.provide(s.layer))})(B0||={});class V0 extends w.TaggedErrorClass()("NpmInstallFailedError",{add:w.Array(w.String).pipe(w.optional),dir:w.String,cause:w.optional(w.Defect)}){}class z0 extends R0.Service()("@qitqode/Npm"){}var c0=process.platform==="win32"?new Set(["<",">",":",'"',"|","?","*"]):void 0;function t0(Z){if(!c0)return Z;return Array.from(Z,(Q)=>c0.has(Q)||Q.charCodeAt(0)<32?"_":Q).join("")}var d0=(Z,Q)=>{let z;try{let $=typeof Bun<"u"?import.meta.resolve(Z,Q):import.meta.resolve(Q);z=L.some($)}catch{z=L.none()}return{directory:Q,entrypoint:z}},e0=g.effect(z0,J.gen(function*(){let Z=yield*f.Service,Q=yield*s.Service,z=yield*s0.FileSystem,$=yield*B0.Service,X=(H)=>k.join(Q.cache,"packages",t0(H)),Y=(H)=>J.gen(function*(){yield*$.acquire(`npm-install:${H.dir}`);let{Arborist:q}=yield*J.promise(()=>import("./chunk-yp0a8q29.js").then((m)=>X0(m.default,1))),R=new q({path:H.dir,binLinks:!0,progress:!1,savePrefix:"",ignoreScripts:!0});return yield*J.tryPromise({try:()=>R.reify({add:H?.add||[],save:!0,saveType:"prod"}),catch:(N)=>new V0({cause:N,add:H?.add,dir:H.dir})})}).pipe(J.withSpan("Npm.reify",{attributes:H})),U=J.fn("Npm.outdated")(function*(H,q){let R=yield*J.tryPromise({try:()=>fetch(`https://registry.npmjs.org/${H}`),catch:()=>{return}}).pipe(J.orElseSucceed(()=>{return}));if(!R||!R.ok)return!1;let A=(yield*J.tryPromise({try:()=>R.json(),catch:()=>{return}}).pipe(J.orElseSucceed(()=>{return})))?.["dist-tags"]?.latest;if(!A)return!1;if(/[\s^~*xX<>|=]/.test(q))return!b0.default.satisfies(A,q);return b0.default.lt(q,A)}),G=J.fn("Npm.add")(function*(H){let q=X(H),R=(()=>{try{return r0.default(H).name??H}catch{return H}})();if(yield*Z.existsSafe(q))return d0(R,k.join(q,"node_modules",R));let A=(yield*Y({dir:q,add:[H]})).edgesOut.values().next().value?.to;if(!A)return yield*new V0({add:[H],dir:q});return d0(A.name,A.path)},J.scoped),W=J.fn("Npm.install")(function*(H,q){if(!(yield*Z.access(H,{writable:!0}).pipe(J.as(!0),J.orElseSucceed(()=>!1))))return;let N=q?.add.map((A)=>[A.name,A.version].filter(Boolean).join("@"))??[];if(yield*J.gen(function*(){if(!(yield*Z.existsSafe(k.join(H,"node_modules"))))return yield*Y({add:N,dir:H}),!0;return!1}).pipe(J.withSpan("Npm.checkNodeModules")))return;yield*J.gen(function*(){let A=yield*Z.readJson(k.join(H,"package.json")).pipe(J.orElseSucceed(()=>({}))),O=yield*Z.readJson(k.join(H,"package-lock.json")).pipe(J.orElseSucceed(()=>({}))),K=A,y=O,v=new Set([...Object.keys(K?.dependencies||{}),...Object.keys(K?.devDependencies||{}),...Object.keys(K?.peerDependencies||{}),...Object.keys(K?.optionalDependencies||{}),...(q?.add||[]).map((V)=>V.name)]),j=y?.packages?.[""]||{},_=new Set([...Object.keys(j?.dependencies||{}),...Object.keys(j?.devDependencies||{}),...Object.keys(j?.peerDependencies||{}),...Object.keys(j?.optionalDependencies||{})]);for(let V of v)if(!_.has(V)){yield*Y({dir:H,add:N});return}}).pipe(J.withSpan("Npm.checkDirty"));return},J.scoped),I=J.fn("Npm.which")(function*(H){let q=X(H),R=k.join(q,"node_modules",".bin"),N=J.fnUntraced(function*(){let A=yield*z.readDirectory(R).pipe(J.catch(()=>J.succeed([])));if(A.length===0)return L.none();if(A.length===1)return L.some(A[0]);let O=yield*Z.readJson(k.join(q,"node_modules",H,"package.json")).pipe(J.option);if(L.isSome(O)){let K=O.value;if(K?.bin){let y=H.startsWith("@")?H.split("/")[1]:H,v=K.bin;if(typeof v==="string")return L.some(y);let j=Object.keys(v);if(j.length===1)return L.some(j[0]);return v[y]?L.some(y):L.some(j[0])}}return L.some(A[0])});return yield*J.gen(function*(){let A=yield*N();if(L.isSome(A))return L.some(k.join(R,A.value));yield*z.remove(k.join(q,"package-lock.json")).pipe(J.orElseSucceed(()=>{})),yield*G(H);let O=yield*N();if(L.isNone(O))return L.none();return L.some(k.join(R,O.value))}).pipe(J.scoped,J.orElseSucceed(()=>L.none()))});return z0.of({add:G,install:W,outdated:U,which:I})})),Z2=e0.pipe(g.provide(B0.layer),g.provide(f.layer),g.provide(s.layer),g.provide(n0.layer)),{runPromise:A0}=h0(z0,Z2);async function N2(...Z){return A0((Q)=>Q.install(...Z))}async function F2(...Z){let Q=await A0((z)=>z.add(...Z));return{directory:Q.directory,entrypoint:L.getOrUndefined(Q.entrypoint)}}async function K2(...Z){return A0((Q)=>Q.outdated(...Z))}async function w2(...Z){let Q=await A0((z)=>z.which(...Z));return L.getOrUndefined(Q)}var Q2=X0(o0(),1),D0=X0(a0(),1);import u from"path";import{fileURLToPath as _0,pathToFileURL as n}from"url";var O2=["opencode-openai-codex-auth","opencode-copilot-auth"];function _Z(Z){return O2.some((Q)=>Z.includes(Q))}function z2(Z){try{return Q2.default(Z)}catch{}}function NZ(Z){let Q=z2(Z);if(Q?.type==="alias"&&!Q.name){let z=Q.subSpec;if(z?.name){let $=!z.rawSpec||z.rawSpec==="*"?"latest":z.rawSpec;return{pkg:z.name,version:$}}}if(!Q?.name)return{pkg:Z,version:""};if(Q.raw===Q.name)return{pkg:Q.name,version:"latest"};return{pkg:Q.name,version:Q.rawSpec}}var b2=["index.ts","index.tsx","index.js","index.mjs","index.cjs"];function X2(Z){if(J2(Z))return"file";return"npm"}function L2(Z,Q){if(Z.startsWith("file://"))return _0(Z);if(u.isAbsolute(Z))return Z;return u.resolve(Q,Z)}function Y2(Z){return u.isAbsolute(Z)||/^[A-Za-z]:[\\/]/.test(Z)}function T2(Z){if(typeof Z==="string")return Z;if(!a(Z))return;for(let Q of["import","default"]){let z=Z[Q];if(typeof z==="string")return z}return}function y2(Z){let Q=Z.json.main;if(typeof Q!=="string")return;let z=Q.trim();if(!z)return;return z}function H2(Z,Q,z,$){let X=L2(Q,$.dir),Y=S.resolve($.dir),U=S.resolve(X);if(!S.contains(Y,U))throw Error(`Plugin ${Z} resolved ${z} entry outside plugin directory`);return U}function $2(Z,Q,z,$){return n(H2(Z,Q,z,$)).href}function P2(Z,Q,z){let $=z.json.exports;if(a($)){let Y=T2($[`./${Q}`]);if(Y)return $2(Z,Y,Q,z)}if(Q!=="server")return;let X=y2(z);if(!X)return;return $2(Z,X,Q,z)}function S2(Z){if(Z.startsWith("file://"))return _0(Z);if(u.isAbsolute(Z))return Z}async function L0(Z){for(let Q of b2){let z=u.join(Z,Q);if(await S.exists(z))return z}}async function m2(Z){let Q=S2(Z);if(!Q)return;if(!(await S.statAsync(Q))?.isDirectory())return;return Q}async function E2(Z,Q,z,$){let X=X2(Z),Y=$??(X==="npm"?await o(Q):await o(Q).catch(()=>{return}));if(!Y)return Q;let U=P2(Z,z,Y);if(U)return U;let G=await m2(Q);if(z==="tui"){if(X==="file"&&G){let W=await L0(G);if(W)return n(W).href}if(X==="npm")return;if(G)return;return Q}if(G&&a(Y.json.exports)){if(X==="file"){let W=await L0(G);if(W)return n(W).href}return}return Q}function J2(Z){return Z.startsWith("file://")||Z.startsWith(".")||Y2(Z)}async function v2(Z){let Q=Z.startsWith("file://")?_0(Z):Z,z=u.isAbsolute(Q)||/^[A-Za-z]:[\\/]/.test(Q)?Q:u.resolve(Q);if(!(await S.statAsync(z))?.isDirectory()){if(Z.startsWith("file://"))return Z;return n(z).href}if(await S.exists(u.join(z,"package.json")))return n(z).href;let X=await L0(z);if(X)return n(X).href;throw Error(`Plugin directory ${z} is missing package.json or index file`)}async function FZ(Z,Q,z){if(!D0.default.valid(Q)||D0.default.major(Q)===0)return;let $=z??await o(Z).catch(()=>{return});if(!$)return;let X=$.json.engines;if(!a(X))return;let Y=X.qitqode??X.opencode;if(typeof Y!=="string")return;if(!D0.default.satisfies(Q,Y))throw Error(`Plugin requires qitqode ${Y} but running ${Q}`)}async function KZ(Z){if(J2(Z))return v2(Z);let Q=z2(Z),z=Q?.name&&Q.raw===Q.name?`${Q.name}@latest`:Z;return(await Y0.add(z)).directory}async function o(Z){let Q=Z.startsWith("file://")?_0(Z):Z,$=(await S.statAsync(Q))?.isDirectory()?Q:u.dirname(Q),X=u.join($,"package.json"),Y=await S.readJson(X);return{dir:$,pkg:X,json:Y}}async function wZ(Z,Q,z){let $=X2(Z),X=$==="npm"?await o(Q):await o(Q).catch(()=>{return}),Y=await E2(Z,Q,z,X);return{spec:Z,source:$,target:Q,pkg:X,entry:Y}}function OZ(Z,Q){let z=Q.json["oc-themes"];if(z===void 0)return[];if(!Array.isArray(z))throw TypeError(`Plugin ${Z} has invalid oc-themes field`);let $=z.map((X)=>{if(typeof X!=="string")throw TypeError(`Plugin ${Z} has invalid oc-themes entry`);let Y=X.trim();if(!Y)throw TypeError(`Plugin ${Z} has empty oc-themes entry`);if(Y.startsWith("file://")||Y2(Y))throw TypeError(`Plugin ${Z} oc-themes entry must be relative: ${X}`);return H2(Z,Y,"oc-themes",Q)});return Array.from(new Set($))}function bZ(Z,Q){if(Z===void 0)return;if(typeof Z!=="string")throw TypeError(`Plugin ${Q} has invalid id type ${typeof Z}`);let z=Z.trim();if(!z)throw TypeError(`Plugin ${Q} has an empty id`);return z}function LZ(Z,Q,z,$="strict"){let X=Z.default;if(!a(X)){if($==="detect")return;throw TypeError(`Plugin ${Q} must default export an object with ${z}()`)}if($==="detect"&&!("id"in X)&&!("server"in X)&&!("tui"in X))return;let Y="server"in X?X.server:void 0,U="tui"in X?X.tui:void 0;if(Y!==void 0&&typeof Y!=="function")throw TypeError(`Plugin ${Q} has invalid server export`);if(U!==void 0&&typeof U!=="function")throw TypeError(`Plugin ${Q} has invalid tui export`);if(Y!==void 0&&U!==void 0)throw TypeError(`Plugin ${Q} must default export either server() or tui(), not both`);if(z==="server"&&Y===void 0)throw TypeError(`Plugin ${Q} must default export an object with server()`);if(z==="tui"&&U===void 0)throw TypeError(`Plugin ${Q} must default export an object with tui()`);return X}async function TZ(Z,Q,z,$,X){if(Z==="file"){if($)return $;throw TypeError(`Path plugin ${Q} must export id`)}if($)return $;let Y=X??await o(z);if(typeof Y.json.name!=="string"||!Y.json.name.trim())throw TypeError(`Plugin package ${Y.pkg} is missing name`);return Y.json.name.trim()}var S0={};i0(S0,{readFile:()=>l2,files:()=>g2,fileInDirectory:()=>f2,directories:()=>k2,claudeCommandDirectories:()=>u2,ConfigPaths:()=>S0});import y0 from"path";var W2=T0.create("ConfigJsonError",p.object({path:p.string(),message:p.string().optional()})),mZ=T0.create("ConfigInvalidError",p.object({path:p.string(),issues:p.custom().optional(),message:p.string().optional()}));var g2=N0("ConfigPaths.projectFiles")(function*(Z,Q,z){return(yield*(yield*f.Service).up({targets:[`${Z}.jsonc`,`${Z}.json`],start:Q,stop:z})).toReversed()}),k2=N0("ConfigPaths.directories")(function*(Z,Q){let z=yield*f.Service;return P0([H0.Path.config,...!r.QITQODE_DISABLE_PROJECT_CONFIG?yield*z.up({targets:[".qitqode"],start:Z,stop:Q}):[],...yield*z.up({targets:[".qitqode"],start:H0.Path.home,stop:H0.Path.home}),...r.QITQODE_CONFIG_DIR?[r.QITQODE_CONFIG_DIR]:[]])}),u2=N0("ConfigPaths.claudeCommandDirectories")(function*(Z,Q){if(r.QITQODE_DISABLE_CLAUDE_CODE_COMMANDS)return[];let z=yield*f.Service;return P0([y0.join(H0.Path.home,".claude"),...!r.QITQODE_DISABLE_PROJECT_CONFIG?yield*z.up({targets:[".claude"],start:Z,stop:Q}):[]])});function f2(Z,Q){return[y0.join(Z,`${Q}.json`),y0.join(Z,`${Q}.jsonc`)]}async function l2(Z){return S.readText(Z).catch((Q)=>{if(Q.code==="ENOENT")return;throw new W2({path:Z},{cause:Q})})}function W0(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&&t(Z.charCodeAt($)))$++}if($<Z.length&&Z.charCodeAt($)===46)if($++,$<Z.length&&t(Z.charCodeAt($))){$++;while($<Z.length&&t(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&&t(Z.charCodeAt($))){$++;while($<Z.length&&t(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(J0(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(m0(j)){do $++,X+=String.fromCharCode(j),j=Z.charCodeAt($);while(m0(j));return U=15}if(J0(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(J0(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($++,J0(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||!t(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(m0(j)||J0(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 m0(Z){return Z===32||Z===9}function J0(Z){return Z===10||Z===13}function t(Z){return Z>=48&&Z<=57}var G2;(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"})(G2||(G2={}));var x=Array(20).fill(0).map((Z,Q)=>{return" ".repeat(Q)});var E0={" ":{"\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{I as M}from"./chunk-s6bar2f9.js";import{Vf as X}from"./chunk-7ppd2phw.js";import{Ag as N,Bg as V,Fg as x,vg as C,yg as L}from"./chunk-
|
|
2
|
+
import{I as M}from"./chunk-s6bar2f9.js";import{Vf as X}from"./chunk-7ppd2phw.js";import{Ag as N,Bg as V,Fg as x,vg as C,yg as L}from"./chunk-my7mn79h.js";import{Jp as B,Op as G}from"./chunk-hk698g9e.js";import{PI as z}from"./chunk-snm5q21k.js";var Z="forgewise";function A(j){if(!j||j.type!=="api")return"skip";if(j.method==="api-key")return"skip";if(L(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(!L(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:M(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=M(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{Lg as a}from"./chunk-
|
|
2
|
+
import{Lg as a}from"./chunk-anjg3mwn.js";import{Yg as t,hh as c}from"./chunk-612f97vv.js";import"./chunk-0nj8axbw.js";import"./chunk-p68rwmhc.js";import"./chunk-0a0vat1h.js";import"./chunk-z8v2tsz2.js";import"./chunk-j8efst22.js";import"./chunk-a1pw9r6f.js";import"./chunk-d5bxan80.js";import"./chunk-8tc8x27z.js";import"./chunk-k7g3h9tn.js";import"./chunk-rmr38x2f.js";import"./chunk-5syxjhg3.js";import"./chunk-nj4d554m.js";import"./chunk-1t6bvbgy.js";import"./chunk-cmbxrgyx.js";import"./chunk-a1p2f16h.js";import"./chunk-nt4e3em9.js";import"./chunk-hk698g9e.js";import"./chunk-v965rsr8.js";import"./chunk-1sgby720.js";import"./chunk-5g8108nf.js";import"./chunk-4tbwha3m.js";import"./chunk-m612agnk.js";import"./chunk-yq3m8190.js";import"./chunk-btz9jvec.js";import"./chunk-cqtkxwd8.js";import"./chunk-fkgv2hqd.js";import"./chunk-zyhdxggp.js";import"./chunk-q6ztpfcs.js";import"./chunk-jm1ptn8n.js";import"./chunk-c5e6sk9c.js";import"./chunk-m02zt1a3.js";import"./chunk-vg2fmyje.js";import"./chunk-fzna6jdj.js";import"./chunk-x1rx6fm7.js";import"./chunk-4qqkqrn9.js";import"./chunk-j6emx6jn.js";import"./chunk-be216spx.js";import"./chunk-12bssxd4.js";import"./chunk-24xc0dvv.js";import"./chunk-ebrt1me3.js";import"./chunk-whxjkz9a.js";import"./chunk-89v6dgpp.js";import{Uu as i}from"./chunk-k309zez0.js";import"./chunk-09kba1hg.js";import"./chunk-t12xrrfr.js";import"./chunk-phxrg7aw.js";import"./chunk-snm5q21k.js";import"./chunk-xpc2zgj7.js";import"./chunk-qjjch1zt.js";import"./chunk-aztre27e.js";var n=i.object({name:a.shape.name,branch:a.shape.branch.unwrap(),directory:a.shape.directory.unwrap()}),d={name:"Worktree",description:"Create a git worktree",async configure(e){let r=await c.runPromise(t.Service.use((o)=>o.makeWorktreeInfo()));return{...e,name:r.name,branch:r.branch,directory:r.directory}},async create(e){let r=n.parse(e);await c.runPromise(t.Service.use((o)=>o.createFromInfo({name:r.name,directory:r.directory,branch:r.branch})))},async remove(e){let r=n.parse(e);await c.runPromise(t.Service.use((o)=>o.remove({directory:r.directory})))},target(e){return{type:"local",directory:n.parse(e).directory}}};export{d as WorktreeAdaptor};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ed as s}from"./chunk-qt1wffbh.js";import{Rd as r}from"./chunk-yajd975f.js";import{hh as i}from"./chunk-wrw22v0a.js";import{Uh as z,Vh as B,jh as u,kh as g,oh as q}from"./chunk-h7yya9pv.js";import"./chunk-p68rwmhc.js";import"./chunk-0a0vat1h.js";import"./chunk-z8v2tsz2.js";import"./chunk-j8efst22.js";import"./chunk-a1pw9r6f.js";import"./chunk-d5bxan80.js";import{Cl as K,Dl as J,Xk as f,lk as G,mk as V,pk as S,rl as x,xk as $}from"./chunk-gsvdt4kq.js";import"./chunk-b7mg883n.js";import{jm as R,lm as p}from"./chunk-90zd5rss.js";import"./chunk-17psxhve.js";import"./chunk-nj4d554m.js";import"./chunk-m2x9xhha.js";import"./chunk-2wcv3sq5.js";import"./chunk-a1p2f16h.js";import"./chunk-nt4e3em9.js";import"./chunk-ak5ngp50.js";import"./chunk-v965rsr8.js";import"./chunk-1sgby720.js";import"./chunk-jg7s9rqz.js";import"./chunk-4tbwha3m.js";import"./chunk-m612agnk.js";import"./chunk-yq3m8190.js";import"./chunk-btz9jvec.js";import"./chunk-cqtkxwd8.js";import"./chunk-fkgv2hqd.js";import"./chunk-zyhdxggp.js";import"./chunk-q6ztpfcs.js";import"./chunk-jm1ptn8n.js";import"./chunk-c5e6sk9c.js";import"./chunk-m02zt1a3.js";import"./chunk-vg2fmyje.js";import"./chunk-c0796v8j.js";import"./chunk-njnwdgvd.js";import"./chunk-4qqkqrn9.js";import"./chunk-j6emx6jn.js";import"./chunk-be216spx.js";import"./chunk-12bssxd4.js";import"./chunk-k9b1jcqw.js";import{ou as U,yu as w}from"./chunk-zxaaxb99.js";import"./chunk-whxjkz9a.js";import"./chunk-89v6dgpp.js";import"./chunk-k309zez0.js";import"./chunk-09kba1hg.js";import"./chunk-t12xrrfr.js";import"./chunk-phxrg7aw.js";import{PI as c,oP as A}from"./chunk-snm5q21k.js";import"./chunk-xpc2zgj7.js";import"./chunk-qjjch1zt.js";import{eQ as v,fQ as P}from"./chunk-aztre27e.js";import{EOL as X}from"os";var k=r({command:"config",describe:"show resolved configuration",builder:(e)=>e,async handler(){await s(process.cwd(),async()=>{let e=await i.runPromise(J.Service.use((o)=>o.get()));process.stdout.write(JSON.stringify(e,null,2)+X)})}});import{EOL as y}from"os";var Y=r({command:"search <query>",describe:"search files by query",builder:(e)=>e.positional("query",{type:"string",demandOption:!0,description:"Search query"}),async handler(e){await s(process.cwd(),async()=>{let o=await i.runPromise(g.Service.use((t)=>t.search({query:e.query})));process.stdout.write(o.join(y)+y)})}}),Z=r({command:"read <path>",describe:"read file contents as JSON",builder:(e)=>e.positional("path",{type:"string",demandOption:!0,description:"File path to read"}),async handler(e){await s(process.cwd(),async()=>{let o=await i.runPromise(g.Service.use((t)=>t.read(e.path)));process.stdout.write(JSON.stringify(o,null,2)+y)})}}),H=r({command:"status",describe:"show file status information",builder:(e)=>e,async handler(){await s(process.cwd(),async()=>{let e=await i.runPromise(g.Service.use((o)=>o.status()));process.stdout.write(JSON.stringify(e,null,2)+y)})}}),ee=r({command:"list <path>",describe:"list files in a directory",builder:(e)=>e.positional("path",{type:"string",demandOption:!0,description:"File path to list"}),async handler(e){await s(process.cwd(),async()=>{let o=await i.runPromise(g.Service.use((t)=>t.list(e.path)));process.stdout.write(JSON.stringify(o,null,2)+y)})}}),oe=r({command:"tree [dir]",describe:"show directory tree",builder:(e)=>e.positional("dir",{type:"string",description:"Directory to tree",default:process.cwd()}),async handler(e){await s(process.cwd(),async()=>{let o=await i.runPromise(u.Service.use((t)=>t.tree({cwd:e.dir,limit:200})));console.log(JSON.stringify(o,null,2))})}}),L=r({command:"file",describe:"file system debugging utilities",builder:(e)=>e.command(Z).command(H).command(ee).command(Y).command(oe).demandCommand(),async handler(){}});import{EOL as D}from"os";var E=r({command:"lsp",describe:"LSP debugging utilities",builder:(e)=>e.command(te).command(re).command(ie).demandCommand(),async handler(){}}),te=r({command:"diagnostics <file>",describe:"get diagnostics for a file",builder:(e)=>e.positional("file",{type:"string",demandOption:!0}),async handler(e){await s(process.cwd(),async()=>{let o=await i.runPromise(S.Service.use((t)=>c.gen(function*(){return yield*t.touchFile(e.file,!0),yield*c.sleep(1000),yield*t.diagnostics()})));process.stdout.write(JSON.stringify(o,null,2)+D)})}}),re=r({command:"symbols <query>",describe:"search workspace symbols",builder:(e)=>e.positional("query",{type:"string",demandOption:!0}),async handler(e){await s(process.cwd(),async()=>{let n=[];try{const o=v(n,w.Default.time("symbols"),0);let t=await i.runPromise(S.Service.use((d)=>d.workspaceSymbol(e.query)));process.stdout.write(JSON.stringify(t,null,2)+D)}catch(a){var m=a,l=1}finally{P(n,m,l)}})}}),ie=r({command:"document-symbols <uri>",describe:"get symbols from a document",builder:(e)=>e.positional("uri",{type:"string",demandOption:!0}),async handler(e){await s(process.cwd(),async()=>{let n=[];try{const o=v(n,w.Default.time("document-symbols"),0);let t=await i.runPromise(S.Service.use((d)=>d.documentSymbol(e.uri)));process.stdout.write(JSON.stringify(t,null,2)+D)}catch(a){var m=a,l=1}finally{P(n,m,l)}})}});import{EOL as C}from"os";var F=r({command:"rg",describe:"ripgrep debugging utilities",builder:(e)=>e.command(se).command(ne).command(ae).demandCommand(),async handler(){}}),se=r({command:"tree",describe:"show file tree using ripgrep",builder:(e)=>e.option("limit",{type:"number"}),async handler(e){await s(process.cwd(),async()=>{let o=await i.runPromise(u.Service.use((t)=>t.tree({cwd:p.directory,limit:e.limit})));process.stdout.write(o+C)})}}),ne=r({command:"files",describe:"list files using ripgrep",builder:(e)=>e.option("query",{type:"string",description:"Filter files by query"}).option("glob",{type:"string",description:"Glob pattern to match files"}).option("limit",{type:"number",description:"Limit number of results"}),async handler(e){await s(process.cwd(),async()=>{let o=await i.runPromise(c.gen(function*(){return yield*(yield*u.Service).files({cwd:p.directory,glob:e.glob?[e.glob]:void 0}).pipe(A.take(e.limit??1/0),A.runCollect,c.map((n)=>[...n]))}));process.stdout.write(o.join(C)+C)})}}),ae=r({command:"search <pattern>",describe:"search file contents using ripgrep",builder:(e)=>e.positional("pattern",{type:"string",demandOption:!0,description:"Search pattern"}).option("glob",{type:"array",description:"File glob patterns"}).option("limit",{type:"number",description:"Limit number of results"}),async handler(e){await s(process.cwd(),async()=>{let o=await i.runPromise(u.Service.use((t)=>t.search({cwd:p.directory,pattern:e.pattern,glob:e.glob,limit:e.limit})));process.stdout.write(JSON.stringify(o.items,null,2)+C)})}});import{EOL as me}from"os";var T=r({command:"scrap",describe:"list all known projects",builder:(e)=>e,async handler(){let e=w.Default.time("scrap"),o=await R.list();process.stdout.write(JSON.stringify(o,null,2)+me),e.stop()}});import{EOL as ce}from"os";var j=r({command:"skill",describe:"list all available skills",builder:(e)=>e,async handler(){await s(process.cwd(),async()=>{let e=await i.runPromise(c.gen(function*(){return yield*(yield*q.Service).all()}));process.stdout.write(JSON.stringify(e,null,2)+ce)})}});var M=r({command:"snapshot",describe:"snapshot debugging utilities",builder:(e)=>e.command(de).command(le).command(pe).demandCommand(),async handler(){}}),I=(e)=>s(process.cwd(),async()=>{console.log(await i.runPromise($.Service.use(e)))}),_=(e)=>e.positional("hash",{type:"string",description:"hash",demandOption:!0}),de=r({command:"track",describe:"track current snapshot state",async handler(){await I((e)=>e.track())}}),le=r({command:"patch <hash>",describe:"show patch for a snapshot hash",builder:_,async handler(e){await I((o)=>o.patch(e.hash))}}),pe=r({command:"diff <hash>",describe:"show diff for a snapshot hash",builder:_,async handler(e){await I((o)=>o.diff(e.hash))}});import{EOL as b}from"os";import{basename as ue}from"path";var Q=r({command:"agent <name>",describe:"show agent configuration details",builder:(e)=>e.positional("name",{type:"string",demandOption:!0,description:"Agent name"}).option("tool",{type:"string",description:"Tool id to execute"}).option("params",{type:"string",description:"Tool params as a JSON object"}),async handler(e){await s(process.cwd(),async()=>{let o=e.name,t=await i.runPromise(B.Service.use((d)=>d.get(o)));if(!t)process.stderr.write(`Agent ${o} not found, run '${ue(process.execPath)} agent list' to get an agent list`+b),process.exit(1);let n=await fe(t),a=await ye(t,n),m=e.tool;if(m){let d=n.find((W)=>W.id===m);if(!d)process.stderr.write(`Tool ${m} not found for agent ${o}`+b),process.exit(1);if(a[m]===!1)process.stderr.write(`Tool ${m} is disabled for agent ${o}`+b),process.exit(1);let h=ge(e.params),O=await we(t),N=await d.execute(h,O);process.stdout.write(JSON.stringify({tool:m,input:h,result:N},null,2)+b);return}let l={...t,tools:a};process.stdout.write(JSON.stringify(l,null,2)+b)})}});async function fe(e){return i.runPromise(c.gen(function*(){let o=yield*x.Service,t=yield*z.Service,n=e.model??(yield*o.defaultModel());return yield*t.tools({...n,agent:e})}))}async function ye(e,o){let t=f.disabled(o.map((a)=>a.id),e.permission),n={};for(let a of o)n[a.id]=!t.has(a.id);return n}function ge(e){if(!e)return{};let o=e.trim();if(o.length===0)return{};let t=(()=>{try{return JSON.parse(o)}catch{throw Error("Failed to parse --params. Provide a valid JSON object.")}})();if(!t||typeof t!=="object"||Array.isArray(t))throw Error("Tool params must be an object.");return t}async function we(e){let{session:o,messageID:t}=await i.runPromise(c.gen(function*(){let a=yield*K.Service,m=yield*a.create({title:`Debug tool run (${e.name})`}),l=G.ascending(),d=e.model?e.model:yield*c.gen(function*(){return yield*(yield*x.Service).defaultModel()}),h=Date.now(),O={id:l,sessionID:m.id,role:"assistant",time:{created:h},parentID:l,modelID:d.modelID,providerID:d.providerID,mode:"debug",agent:e.name,path:{cwd:p.directory,root:p.worktree},cost:0,tokens:{input:0,output:0,reasoning:0,cache:{read:0,write:0}}};return yield*a.updateMessage(O),{session:m,messageID:l}})),n=f.merge(e.permission,o.permission??[]);return{sessionID:o.id,messageID:t,callID:V.ascending(),agent:e.name,abort:new AbortController().signal,messages:[],metadata:()=>c.void,ask(a){return c.sync(()=>{for(let m of a.patterns)if(f.evaluate(a.permission,m,n).action==="deny")throw new f.DeniedError({ruleset:n})})}}}var jo=r({command:"debug",describe:"debugging and troubleshooting tools",builder:(e)=>e.command(k).command(E).command(F).command(L).command(T).command(j).command(M).command(Q).command(be).command({command:"wait",describe:"wait indefinitely (for debugging)",async handler(){await s(process.cwd(),async()=>{await new Promise((o)=>setTimeout(o,86400000))})}}).demandCommand(),async handler(){}}),be=r({command:"paths",describe:"show global paths (data, config, cache, state)",handler(){for(let[e,o]of Object.entries(U.Path))console.log(e.padEnd(10),o)}});export{jo as DebugCommand};
|
|
2
|
+
import{Ed as s}from"./chunk-pdzpfkt0.js";import{Rd as r}from"./chunk-yajd975f.js";import{hh as i}from"./chunk-612f97vv.js";import{Uh as z,Vh as B,jh as u,kh as g,oh as q}from"./chunk-0nj8axbw.js";import"./chunk-p68rwmhc.js";import"./chunk-0a0vat1h.js";import"./chunk-z8v2tsz2.js";import"./chunk-j8efst22.js";import"./chunk-a1pw9r6f.js";import"./chunk-d5bxan80.js";import{Cl as K,Dl as J,Xk as f,lk as G,mk as V,pk as S,rl as x,xk as $}from"./chunk-8tc8x27z.js";import"./chunk-k7g3h9tn.js";import{jm as R,lm as p}from"./chunk-rmr38x2f.js";import"./chunk-5syxjhg3.js";import"./chunk-nj4d554m.js";import"./chunk-1t6bvbgy.js";import"./chunk-cmbxrgyx.js";import"./chunk-a1p2f16h.js";import"./chunk-nt4e3em9.js";import"./chunk-hk698g9e.js";import"./chunk-v965rsr8.js";import"./chunk-1sgby720.js";import"./chunk-5g8108nf.js";import"./chunk-4tbwha3m.js";import"./chunk-m612agnk.js";import"./chunk-yq3m8190.js";import"./chunk-btz9jvec.js";import"./chunk-cqtkxwd8.js";import"./chunk-fkgv2hqd.js";import"./chunk-zyhdxggp.js";import"./chunk-q6ztpfcs.js";import"./chunk-jm1ptn8n.js";import"./chunk-c5e6sk9c.js";import"./chunk-m02zt1a3.js";import"./chunk-vg2fmyje.js";import"./chunk-fzna6jdj.js";import"./chunk-x1rx6fm7.js";import"./chunk-4qqkqrn9.js";import"./chunk-j6emx6jn.js";import"./chunk-be216spx.js";import"./chunk-12bssxd4.js";import"./chunk-24xc0dvv.js";import{ou as U,yu as w}from"./chunk-ebrt1me3.js";import"./chunk-whxjkz9a.js";import"./chunk-89v6dgpp.js";import"./chunk-k309zez0.js";import"./chunk-09kba1hg.js";import"./chunk-t12xrrfr.js";import"./chunk-phxrg7aw.js";import{PI as c,oP as A}from"./chunk-snm5q21k.js";import"./chunk-xpc2zgj7.js";import"./chunk-qjjch1zt.js";import{eQ as v,fQ as P}from"./chunk-aztre27e.js";import{EOL as X}from"os";var k=r({command:"config",describe:"show resolved configuration",builder:(e)=>e,async handler(){await s(process.cwd(),async()=>{let e=await i.runPromise(J.Service.use((o)=>o.get()));process.stdout.write(JSON.stringify(e,null,2)+X)})}});import{EOL as y}from"os";var Y=r({command:"search <query>",describe:"search files by query",builder:(e)=>e.positional("query",{type:"string",demandOption:!0,description:"Search query"}),async handler(e){await s(process.cwd(),async()=>{let o=await i.runPromise(g.Service.use((t)=>t.search({query:e.query})));process.stdout.write(o.join(y)+y)})}}),Z=r({command:"read <path>",describe:"read file contents as JSON",builder:(e)=>e.positional("path",{type:"string",demandOption:!0,description:"File path to read"}),async handler(e){await s(process.cwd(),async()=>{let o=await i.runPromise(g.Service.use((t)=>t.read(e.path)));process.stdout.write(JSON.stringify(o,null,2)+y)})}}),H=r({command:"status",describe:"show file status information",builder:(e)=>e,async handler(){await s(process.cwd(),async()=>{let e=await i.runPromise(g.Service.use((o)=>o.status()));process.stdout.write(JSON.stringify(e,null,2)+y)})}}),ee=r({command:"list <path>",describe:"list files in a directory",builder:(e)=>e.positional("path",{type:"string",demandOption:!0,description:"File path to list"}),async handler(e){await s(process.cwd(),async()=>{let o=await i.runPromise(g.Service.use((t)=>t.list(e.path)));process.stdout.write(JSON.stringify(o,null,2)+y)})}}),oe=r({command:"tree [dir]",describe:"show directory tree",builder:(e)=>e.positional("dir",{type:"string",description:"Directory to tree",default:process.cwd()}),async handler(e){await s(process.cwd(),async()=>{let o=await i.runPromise(u.Service.use((t)=>t.tree({cwd:e.dir,limit:200})));console.log(JSON.stringify(o,null,2))})}}),L=r({command:"file",describe:"file system debugging utilities",builder:(e)=>e.command(Z).command(H).command(ee).command(Y).command(oe).demandCommand(),async handler(){}});import{EOL as D}from"os";var E=r({command:"lsp",describe:"LSP debugging utilities",builder:(e)=>e.command(te).command(re).command(ie).demandCommand(),async handler(){}}),te=r({command:"diagnostics <file>",describe:"get diagnostics for a file",builder:(e)=>e.positional("file",{type:"string",demandOption:!0}),async handler(e){await s(process.cwd(),async()=>{let o=await i.runPromise(S.Service.use((t)=>c.gen(function*(){return yield*t.touchFile(e.file,!0),yield*c.sleep(1000),yield*t.diagnostics()})));process.stdout.write(JSON.stringify(o,null,2)+D)})}}),re=r({command:"symbols <query>",describe:"search workspace symbols",builder:(e)=>e.positional("query",{type:"string",demandOption:!0}),async handler(e){await s(process.cwd(),async()=>{let n=[];try{const o=v(n,w.Default.time("symbols"),0);let t=await i.runPromise(S.Service.use((d)=>d.workspaceSymbol(e.query)));process.stdout.write(JSON.stringify(t,null,2)+D)}catch(a){var m=a,l=1}finally{P(n,m,l)}})}}),ie=r({command:"document-symbols <uri>",describe:"get symbols from a document",builder:(e)=>e.positional("uri",{type:"string",demandOption:!0}),async handler(e){await s(process.cwd(),async()=>{let n=[];try{const o=v(n,w.Default.time("document-symbols"),0);let t=await i.runPromise(S.Service.use((d)=>d.documentSymbol(e.uri)));process.stdout.write(JSON.stringify(t,null,2)+D)}catch(a){var m=a,l=1}finally{P(n,m,l)}})}});import{EOL as C}from"os";var F=r({command:"rg",describe:"ripgrep debugging utilities",builder:(e)=>e.command(se).command(ne).command(ae).demandCommand(),async handler(){}}),se=r({command:"tree",describe:"show file tree using ripgrep",builder:(e)=>e.option("limit",{type:"number"}),async handler(e){await s(process.cwd(),async()=>{let o=await i.runPromise(u.Service.use((t)=>t.tree({cwd:p.directory,limit:e.limit})));process.stdout.write(o+C)})}}),ne=r({command:"files",describe:"list files using ripgrep",builder:(e)=>e.option("query",{type:"string",description:"Filter files by query"}).option("glob",{type:"string",description:"Glob pattern to match files"}).option("limit",{type:"number",description:"Limit number of results"}),async handler(e){await s(process.cwd(),async()=>{let o=await i.runPromise(c.gen(function*(){return yield*(yield*u.Service).files({cwd:p.directory,glob:e.glob?[e.glob]:void 0}).pipe(A.take(e.limit??1/0),A.runCollect,c.map((n)=>[...n]))}));process.stdout.write(o.join(C)+C)})}}),ae=r({command:"search <pattern>",describe:"search file contents using ripgrep",builder:(e)=>e.positional("pattern",{type:"string",demandOption:!0,description:"Search pattern"}).option("glob",{type:"array",description:"File glob patterns"}).option("limit",{type:"number",description:"Limit number of results"}),async handler(e){await s(process.cwd(),async()=>{let o=await i.runPromise(u.Service.use((t)=>t.search({cwd:p.directory,pattern:e.pattern,glob:e.glob,limit:e.limit})));process.stdout.write(JSON.stringify(o.items,null,2)+C)})}});import{EOL as me}from"os";var T=r({command:"scrap",describe:"list all known projects",builder:(e)=>e,async handler(){let e=w.Default.time("scrap"),o=await R.list();process.stdout.write(JSON.stringify(o,null,2)+me),e.stop()}});import{EOL as ce}from"os";var j=r({command:"skill",describe:"list all available skills",builder:(e)=>e,async handler(){await s(process.cwd(),async()=>{let e=await i.runPromise(c.gen(function*(){return yield*(yield*q.Service).all()}));process.stdout.write(JSON.stringify(e,null,2)+ce)})}});var M=r({command:"snapshot",describe:"snapshot debugging utilities",builder:(e)=>e.command(de).command(le).command(pe).demandCommand(),async handler(){}}),I=(e)=>s(process.cwd(),async()=>{console.log(await i.runPromise($.Service.use(e)))}),_=(e)=>e.positional("hash",{type:"string",description:"hash",demandOption:!0}),de=r({command:"track",describe:"track current snapshot state",async handler(){await I((e)=>e.track())}}),le=r({command:"patch <hash>",describe:"show patch for a snapshot hash",builder:_,async handler(e){await I((o)=>o.patch(e.hash))}}),pe=r({command:"diff <hash>",describe:"show diff for a snapshot hash",builder:_,async handler(e){await I((o)=>o.diff(e.hash))}});import{EOL as b}from"os";import{basename as ue}from"path";var Q=r({command:"agent <name>",describe:"show agent configuration details",builder:(e)=>e.positional("name",{type:"string",demandOption:!0,description:"Agent name"}).option("tool",{type:"string",description:"Tool id to execute"}).option("params",{type:"string",description:"Tool params as a JSON object"}),async handler(e){await s(process.cwd(),async()=>{let o=e.name,t=await i.runPromise(B.Service.use((d)=>d.get(o)));if(!t)process.stderr.write(`Agent ${o} not found, run '${ue(process.execPath)} agent list' to get an agent list`+b),process.exit(1);let n=await fe(t),a=await ye(t,n),m=e.tool;if(m){let d=n.find((W)=>W.id===m);if(!d)process.stderr.write(`Tool ${m} not found for agent ${o}`+b),process.exit(1);if(a[m]===!1)process.stderr.write(`Tool ${m} is disabled for agent ${o}`+b),process.exit(1);let h=ge(e.params),O=await we(t),N=await d.execute(h,O);process.stdout.write(JSON.stringify({tool:m,input:h,result:N},null,2)+b);return}let l={...t,tools:a};process.stdout.write(JSON.stringify(l,null,2)+b)})}});async function fe(e){return i.runPromise(c.gen(function*(){let o=yield*x.Service,t=yield*z.Service,n=e.model??(yield*o.defaultModel());return yield*t.tools({...n,agent:e})}))}async function ye(e,o){let t=f.disabled(o.map((a)=>a.id),e.permission),n={};for(let a of o)n[a.id]=!t.has(a.id);return n}function ge(e){if(!e)return{};let o=e.trim();if(o.length===0)return{};let t=(()=>{try{return JSON.parse(o)}catch{throw Error("Failed to parse --params. Provide a valid JSON object.")}})();if(!t||typeof t!=="object"||Array.isArray(t))throw Error("Tool params must be an object.");return t}async function we(e){let{session:o,messageID:t}=await i.runPromise(c.gen(function*(){let a=yield*K.Service,m=yield*a.create({title:`Debug tool run (${e.name})`}),l=G.ascending(),d=e.model?e.model:yield*c.gen(function*(){return yield*(yield*x.Service).defaultModel()}),h=Date.now(),O={id:l,sessionID:m.id,role:"assistant",time:{created:h},parentID:l,modelID:d.modelID,providerID:d.providerID,mode:"debug",agent:e.name,path:{cwd:p.directory,root:p.worktree},cost:0,tokens:{input:0,output:0,reasoning:0,cache:{read:0,write:0}}};return yield*a.updateMessage(O),{session:m,messageID:l}})),n=f.merge(e.permission,o.permission??[]);return{sessionID:o.id,messageID:t,callID:V.ascending(),agent:e.name,abort:new AbortController().signal,messages:[],metadata:()=>c.void,ask(a){return c.sync(()=>{for(let m of a.patterns)if(f.evaluate(a.permission,m,n).action==="deny")throw new f.DeniedError({ruleset:n})})}}}var jo=r({command:"debug",describe:"debugging and troubleshooting tools",builder:(e)=>e.command(k).command(E).command(F).command(L).command(T).command(j).command(M).command(Q).command(be).command({command:"wait",describe:"wait indefinitely (for debugging)",async handler(){await s(process.cwd(),async()=>{await new Promise((o)=>setTimeout(o,86400000))})}}).demandCommand(),async handler(){}}),be=r({command:"paths",describe:"show global paths (data, config, cache, state)",handler(){for(let[e,o]of Object.entries(U.Path))console.log(e.padEnd(10),o)}});export{jo as DebugCommand};
|