noskills 4.5.1 → 5.0.0
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/README.md +497 -18
- package/noskills.js +145 -1
- package/package.json +14 -1
- package/{chunks/ajan-bridge-T5M4DPDT.js → ts/chunks/ajan-bridge-6UUIUFAV.js} +1 -1
- package/ts/chunks/anthropic-ICVQ5GK6.js +1 -0
- package/ts/chunks/approve-R7MCYHCS.js +1 -0
- package/ts/chunks/ask-GBLFPNFX.js +2 -0
- package/ts/chunks/block-YEKLMXHR.js +1 -0
- package/ts/chunks/cancel-7NS4WM2N.js +1 -0
- package/ts/chunks/chunk-2CLD527I.js +1 -0
- package/ts/chunks/chunk-34AWV7DB.js +1 -0
- package/ts/chunks/chunk-3M26Y3NG.js +27 -0
- package/{chunks/chunk-KM64FL2X.js → ts/chunks/chunk-3QVRJO3V.js} +1 -1
- package/ts/chunks/chunk-5ALJRBMW.js +22 -0
- package/ts/chunks/chunk-5NMDE2VZ.js +4 -0
- package/ts/chunks/chunk-6BKTY7SA.js +4 -0
- package/ts/chunks/chunk-6M7PCVUR.js +1 -0
- package/ts/chunks/chunk-6O2RXYTM.js +3 -0
- package/ts/chunks/chunk-7DIQYKPL.js +3 -0
- package/ts/chunks/chunk-7J6R2D2K.js +2 -0
- package/ts/chunks/chunk-ATNTR7M5.js +1 -0
- package/ts/chunks/chunk-AW3XJGEP.js +1 -0
- package/ts/chunks/chunk-BRC46A3N.js +39 -0
- package/ts/chunks/chunk-C5LYQDQH.js +368 -0
- package/ts/chunks/chunk-CCYWFSXR.js +3 -0
- package/{chunks/chunk-OAWYVETM.js → ts/chunks/chunk-CL55MNGD.js} +1 -1
- package/ts/chunks/chunk-CSP2GUD4.js +29 -0
- package/{chunks/chunk-EROZRDGT.js → ts/chunks/chunk-D2UKX2VW.js} +1 -1
- package/ts/chunks/chunk-DGYDUGTM.js +1 -0
- package/ts/chunks/chunk-FB3Z7XYQ.js +1 -0
- package/ts/chunks/chunk-FLLYK5FU.js +1 -0
- package/{chunks/chunk-EJYSOUEA.js → ts/chunks/chunk-GCPGG4YB.js} +1 -1
- package/{chunks/chunk-LN4NDYT6.js → ts/chunks/chunk-HLDPASM6.js} +1 -1
- package/ts/chunks/chunk-HNQA5O2S.js +2 -0
- package/ts/chunks/chunk-HUP7XWW6.js +1 -0
- package/ts/chunks/chunk-J3XNDEMU.js +4 -0
- package/ts/chunks/chunk-K6FVY52W.js +5 -0
- package/ts/chunks/chunk-KQJGXVWX.js +91 -0
- package/ts/chunks/chunk-M4U4Y3XQ.js +7 -0
- package/ts/chunks/chunk-M6CAJL36.js +1 -0
- package/ts/chunks/chunk-MPHTBN7E.js +1 -0
- package/ts/chunks/chunk-NYIFCLEG.js +1 -0
- package/ts/chunks/chunk-RRDWQKZY.js +1 -0
- package/ts/chunks/chunk-RVNSKPFL.js +1 -0
- package/ts/chunks/chunk-S5F2DAAG.js +5 -0
- package/ts/chunks/chunk-SCYP2G2T.js +3 -0
- package/ts/chunks/chunk-SWP6BJR6.js +147 -0
- package/{chunks/chunk-XDRX4ZBJ.js → ts/chunks/chunk-SWRVSRYY.js} +1 -1
- package/ts/chunks/chunk-T2X4E35X.js +1 -0
- package/ts/chunks/chunk-TDLTCTV4.js +1 -0
- package/ts/chunks/chunk-TKBGNLNV.js +1 -0
- package/ts/chunks/chunk-UY4YFVSW.js +3 -0
- package/ts/chunks/chunk-V5ZXCJPI.js +2 -0
- package/ts/chunks/chunk-W46BJM2F.js +1 -0
- package/ts/chunks/chunk-W7KQFMHV.js +1 -0
- package/ts/chunks/chunk-XGRZPTAD.js +24 -0
- package/ts/chunks/chunk-XTQFSF6C.js +1 -0
- package/ts/chunks/chunk-YN3SHWBR.js +1 -0
- package/ts/chunks/chunk-ZAY6LSJD.js +2 -0
- package/ts/chunks/chunk-ZGVXR3EC.js +8 -0
- package/ts/chunks/chunk-ZW5C5IGT.js +32 -0
- package/ts/chunks/claude-code-J2V5WSGZ.js +1 -0
- package/ts/chunks/concern-EDWQHU4H.js +1 -0
- package/ts/chunks/config-E7BDBHPK.js +1 -0
- package/ts/chunks/decision-ledger-5QXKZSV2.js +1 -0
- package/ts/chunks/delegate-LVQQ3GCV.js +1 -0
- package/ts/chunks/diagrams-2F5ZYXA7.js +1 -0
- package/ts/chunks/diagrams-H62JGTIS.js +1 -0
- package/ts/chunks/done-U3TOSZIX.js +1 -0
- package/ts/chunks/followup-J2HJU3ZT.js +1 -0
- package/ts/chunks/free-73WMLMCT.js +1 -0
- package/ts/chunks/gemini-GA6P4M7D.js +1 -0
- package/ts/chunks/init-6CVDGRY2.js +1 -0
- package/ts/chunks/invoke-hook-2TMKWL7I.js +15 -0
- package/ts/chunks/kiro-BJSKSAUC.js +1 -0
- package/ts/chunks/learn-7Q2VWZMI.js +7 -0
- package/ts/chunks/ledger-XR4AHZRX.js +2 -0
- package/ts/chunks/list-CUQCPXZH.js +1 -0
- package/ts/chunks/manager-WTLJ5C2I.js +3 -0
- package/ts/chunks/mod-BZA5TFW7.js +1 -0
- package/ts/chunks/mod-RWA5ZPYH.js +1 -0
- package/ts/chunks/mod-X372UNSQ.js +1 -0
- package/ts/chunks/mod-XVE4ZWPY.js +1 -0
- package/ts/chunks/next-CEYZSYGB.js +20 -0
- package/ts/chunks/node-33JV5VS3.js +15 -0
- package/ts/chunks/node-XYP2DQHR.js +74 -0
- package/ts/chunks/node-ZSGIX7K3.js +1 -0
- package/ts/chunks/ollama-X6OGN5BW.js +1 -0
- package/ts/chunks/openai-TV7KLQ2C.js +1 -0
- package/ts/chunks/openai-YPM2E7QS.js +30 -0
- package/ts/chunks/opencode-AK6WWZRF.js +1 -0
- package/ts/chunks/pack-EOUSZGJT.js +5 -0
- package/ts/chunks/plan-export-ZBINRAAS.js +3 -0
- package/ts/chunks/purge-GPMC5A6Y.js +5 -0
- package/ts/chunks/reopen-LPVNZN5I.js +1 -0
- package/ts/chunks/reset-RNLPXGWQ.js +1 -0
- package/ts/chunks/review-ZGAY5XCN.js +1 -0
- package/ts/chunks/rule-SNBQ4VZD.js +6 -0
- package/ts/chunks/run-4TDP4C7Z.js +3 -0
- package/ts/chunks/sdk-MEVPL5WT.js +1 -0
- package/ts/chunks/session-J7TSLNEH.js +1 -0
- package/ts/chunks/spec-3NSPFDIC.js +1 -0
- package/ts/chunks/status-DIEA2OGR.js +1 -0
- package/ts/chunks/sync-HZNKILSP.js +1 -0
- package/ts/chunks/validate-MWHDOF2F.js +1 -0
- package/ts/chunks/vertexai-ARXI4AMJ.js +1 -0
- package/ts/chunks/watch-P6HABMAS.js +7 -0
- package/ts/chunks/web-BMIC3VJQ.js +1 -0
- package/ts/chunks/wontfix-6UKEYTVB.js +1 -0
- package/ts/noskills.js +2 -0
- package/chunks/anthropic-TS7EMQML.js +0 -1
- package/chunks/approve-HEW3VFYH.js +0 -1
- package/chunks/ask-AXHTCVD6.js +0 -2
- package/chunks/block-VN76CXZW.js +0 -1
- package/chunks/browser-BGFD24RX.js +0 -1
- package/chunks/bun-WZ7BVR7Y.js +0 -1
- package/chunks/cancel-7WRAST62.js +0 -1
- package/chunks/chunk-3ZJ3UGQL.js +0 -48
- package/chunks/chunk-4PF2MT7S.js +0 -29
- package/chunks/chunk-575Y3OEG.js +0 -1
- package/chunks/chunk-5DZHAHXW.js +0 -110
- package/chunks/chunk-5PBNUBBY.js +0 -3
- package/chunks/chunk-5RLCKUIF.js +0 -2
- package/chunks/chunk-6YSS6PEL.js +0 -3
- package/chunks/chunk-7GC46XEU.js +0 -1
- package/chunks/chunk-7PPUGTKL.js +0 -4
- package/chunks/chunk-AUZWXMWA.js +0 -27
- package/chunks/chunk-CH6A3LES.js +0 -91
- package/chunks/chunk-CML74SNT.js +0 -3
- package/chunks/chunk-CTTMQSHF.js +0 -1
- package/chunks/chunk-DBKXMYLF.js +0 -4
- package/chunks/chunk-DEHRWREM.js +0 -1
- package/chunks/chunk-EIGFDYGQ.js +0 -1
- package/chunks/chunk-EIMBEXUJ.js +0 -1
- package/chunks/chunk-ENP4P2YH.js +0 -0
- package/chunks/chunk-FE4MKOI4.js +0 -1
- package/chunks/chunk-GQTHILPL.js +0 -5
- package/chunks/chunk-IFE5SYGK.js +0 -1
- package/chunks/chunk-IGDFEGCH.js +0 -2
- package/chunks/chunk-JL3MAFYQ.js +0 -1
- package/chunks/chunk-JYVB6UAV.js +0 -1
- package/chunks/chunk-KJLEPI7T.js +0 -1
- package/chunks/chunk-KMLNG3EC.js +0 -1
- package/chunks/chunk-KRKOWSYW.js +0 -148
- package/chunks/chunk-KRRPOVQG.js +0 -1
- package/chunks/chunk-LJEWPIEI.js +0 -1
- package/chunks/chunk-NGCBWJML.js +0 -2
- package/chunks/chunk-O4KKKYCH.js +0 -1
- package/chunks/chunk-PKEQKXZW.js +0 -23
- package/chunks/chunk-PRQ5CRIG.js +0 -1
- package/chunks/chunk-PSX63TYP.js +0 -2
- package/chunks/chunk-Q4TI7EYT.js +0 -5
- package/chunks/chunk-QKWJ72HI.js +0 -3
- package/chunks/chunk-RAQY37P6.js +0 -1
- package/chunks/chunk-S4MUTKHT.js +0 -4
- package/chunks/chunk-SLO22P65.js +0 -1
- package/chunks/chunk-UE56BMAW.js +0 -21
- package/chunks/chunk-VJRCTYGL.js +0 -1
- package/chunks/chunk-VXU6XZ66.js +0 -39
- package/chunks/chunk-W4TQLLUK.js +0 -7
- package/chunks/chunk-Y5E7ZCCX.js +0 -1
- package/chunks/chunk-Z7OYXH3J.js +0 -1
- package/chunks/claude-code-DIWRQKZA.js +0 -1
- package/chunks/cmd-46ZIHXLB.js +0 -1
- package/chunks/concern-QSENGU6C.js +0 -1
- package/chunks/config-S3UXTJN2.js +0 -1
- package/chunks/decision-ledger-GY2W6VWL.js +0 -1
- package/chunks/delegate-WKXIER7E.js +0 -1
- package/chunks/deno-YM5PW6ZM.js +0 -1
- package/chunks/diagrams-A7W2EBYV.js +0 -1
- package/chunks/diagrams-CBCUA47B.js +0 -1
- package/chunks/done-WR3UFYJT.js +0 -1
- package/chunks/followup-5EGZEF5Q.js +0 -1
- package/chunks/free-KJQHRYZA.js +0 -1
- package/chunks/gemini-IWP24T63.js +0 -1
- package/chunks/init-437SU6XH.js +0 -1
- package/chunks/invoke-hook-LMCWNF65.js +0 -13
- package/chunks/kiro-THWCXS5L.js +0 -1
- package/chunks/learn-ZTYKBZER.js +0 -7
- package/chunks/ledger-FOOPJ2UO.js +0 -1
- package/chunks/list-HNGIOVBK.js +0 -1
- package/chunks/loader-command-3A5FK2RF.js +0 -1
- package/chunks/loader-reactor-YZM7HO4G.js +0 -1
- package/chunks/manager-2MOLEJ4Q.js +0 -3
- package/chunks/mod-6EZYRKWV.js +0 -1
- package/chunks/mod-7VTKN6Q5.js +0 -1
- package/chunks/mod-7X5TKHKC.js +0 -1
- package/chunks/mod-AJIRKRAH.js +0 -1
- package/chunks/mod-SFSUQWSB.js +0 -8
- package/chunks/mod-TGOMO3CJ.js +0 -1
- package/chunks/next-Y6FOPM4Z.js +0 -15
- package/chunks/node-AZK2C657.js +0 -12
- package/chunks/node-GQQ42DT2.js +0 -68
- package/chunks/node-J4GTOSL2.js +0 -1
- package/chunks/ollama-2KAMCXVL.js +0 -1
- package/chunks/openai-HHE35TAX.js +0 -31
- package/chunks/openai-YES2XJDU.js +0 -1
- package/chunks/opencode-S4M7WJTO.js +0 -1
- package/chunks/pack-KUT53Z24.js +0 -5
- package/chunks/plan-export-PG2BVRQZ.js +0 -3
- package/chunks/purge-JGNJNEET.js +0 -4
- package/chunks/reopen-RPDXN3CF.js +0 -1
- package/chunks/reset-RBCQO2RF.js +0 -1
- package/chunks/review-VMS5MYOV.js +0 -1
- package/chunks/rule-IB4VKSBC.js +0 -6
- package/chunks/run-62PWXVII.js +0 -3
- package/chunks/sdk-FR7Z4YSC.js +0 -1
- package/chunks/session-Q43KMFL2.js +0 -1
- package/chunks/spec-4RKLPOEM.js +0 -1
- package/chunks/status-OGLFEFF7.js +0 -1
- package/chunks/sync-H35O5DN5.js +0 -1
- package/chunks/unstable_chmod-44MCKF3B.js +0 -1
- package/chunks/validate-JX7UTAK5.js +0 -1
- package/chunks/vertexai-WF5CKMYI.js +0 -1
- package/chunks/watch-SOZDHLSC.js +0 -8
- package/chunks/web-3VGRM3W4.js +0 -1
- package/chunks/wontfix-RBOGLLWJ.js +0 -1
- package/chunks/workerd-I7MLRCLJ.js +0 -1
- /package/{chunks → ts/chunks}/chunk-HISXAZ4Y.js +0 -0
- /package/{chunks → ts/chunks}/chunk-I4Z2RF7L.js +0 -0
- /package/{chunks → ts/chunks}/dist-3MH5UCQU.js +0 -0
- /package/{chunks → ts/chunks}/multipart-parser-DKDFOZKD.js +0 -0
- /package/{chunks → ts/chunks}/src-HXQVVTGQ.js +0 -0
package/chunks/chunk-CH6A3LES.js
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import{a as S,b as H}from"./chunk-OAWYVETM.js";import{i as T}from"./chunk-Y5E7ZCCX.js";var de=/^(?:-(?:(?<doubleDash>-)(?<negated>no-)?)?)(?<key>.+?)(?:=(?<value>.*))?$/s,ce=/[A-Za-z]/,ue=/-?\d+(\.\d*)?(e-?\d+)?$/,fe=/^(-|--)[^-]/,ge=/=(?<value>.+)/,me=/^--[^=]+$/,pe=/\W/,he=/\S/;function v(n){return he.test(n)&&Number.isFinite(Number(n))}function V(n,e){return e==="constructor"&&typeof n[e]=="function"||e==="__proto__"}function E(n,e,t,r=!1){e=[...e];let s=e.pop();for(let o of e){if(V(n,o))return;n=n[o]??={}}if(!V(n,s)){if(r){let o=n[s];if(Array.isArray(o)){o.push(t);return}t=o?[o,t]:[t]}n[s]=t}}function j(n,e){for(let t of e){let r=n[t];if(!Object.hasOwn(n,t))return!1;n=r}return!0}function X(n,e,t){let r=n.get(t);if(r===void 0)return!1;for(let s of r)if(e.has(s))return!0;return!1}function U(n){return n==="true"||n==="false"}function L(n){return n!=="false"}function z(n,e){let{"--":t=!1,alias:r={},boolean:s=!1,default:o={},stopEarly:i=!1,string:c=[],collect:m=[],negatable:p=[],unknown:k=l=>l}=e??{},h=new Map,$=new Set,C=new Set,_=new Set,O=new Set,y=!1;if(r)for(let[l,a]of Object.entries(r)){if(a===void 0)throw new TypeError("Alias value must be defined");let u=Array.isArray(a)?a:[a];h.set(l,new Set(u)),u.forEach(F=>h.set(F,new Set([l,...u.filter(w=>w!==F)])))}if(s)if(typeof s=="boolean")y=s;else{let l=Array.isArray(s)?s:[s];for(let a of l.filter(Boolean))$.add(a),h.get(a)?.forEach(u=>{$.add(u)})}if(c){let l=Array.isArray(c)?c:[c];for(let a of l.filter(Boolean))C.add(a),h.get(a)?.forEach(u=>C.add(u))}if(m){let l=Array.isArray(m)?m:[m];for(let a of l.filter(Boolean))_.add(a),h.get(a)?.forEach(u=>_.add(u))}if(p){let l=Array.isArray(p)?p:[p];for(let a of l.filter(Boolean))O.add(a),h.get(a)?.forEach(u=>O.add(u))}let d={_:[]};function g(l,a,u,F){if(!$.has(l)&&!C.has(l)&&!h.has(l)&&!_.has(l)&&!(y&&me.test(u))&&k?.(u,l,a)===!1)return;typeof a=="string"&&!C.has(l)&&(a=v(a)?Number(a):a);let w=F&&_.has(l);E(d,l.split("."),a,w),h.get(l)?.forEach(f=>{E(d,f.split("."),a,w)})}let P=[],A=n.indexOf("--");A!==-1&&(P=n.slice(A+1),n=n.slice(0,A));e:for(let l=0;l<n.length;l++){let a=n[l],u=a.match(de)?.groups;if(u){let{doubleDash:F,negated:w}=u,f=u.key,x=u.value;if(F){if(x!=null){$.has(f)&&(x=L(x)),g(f,x,a,!0);continue}if(w){if(O.has(f)){g(f,!1,a,!1);continue}f=`no-${f}`}let b=n[l+1];if(b){if(!$.has(f)&&!y&&!b.startsWith("-")&&(!h.has(f)||!X(h,$,f))){x=b,l++,g(f,x,a,!0);continue}if(U(b)){x=L(b),l++,g(f,x,a,!0);continue}}x=C.has(f)?"":!0,g(f,x,a,!0);continue}let B=a.slice(1,-1).split("");for(let[b,M]of B.entries()){let R=a.slice(b+2);if(R==="-"){g(M,R,a,!0);continue}if(R==="="){g(M,"",a,!0);continue e}if(ce.test(M)){let W=ge.exec(R)?.groups;if(W){g(M,W.value,a,!0);continue e}if(ue.test(R)){g(M,R,a,!0);continue e}}if(B[b+1]?.match(pe)){g(M,a.slice(b+2),a,!0);continue e}g(M,C.has(M)?"":!0,a,!0)}if(f=a.slice(-1),f==="-")continue;let D=n[l+1];if(D){if(!fe.test(D)&&!$.has(f)&&(!h.has(f)||!X(h,$,f))){g(f,D,a,!0),l++;continue}if(U(D)){let b=L(D);g(f,b,a,!0),l++;continue}}g(f,C.has(f)?"":!0,a,!0);continue}if(k?.(a)!==!1&&d._.push(C.has("_")||!v(a)?a:Number(a)),i){d._.push(...n.slice(l+1));break}}for(let[l,a]of Object.entries(o)){let u=l.split(".");j(d,u)||(E(d,u,a),h.get(l)?.forEach(F=>E(d,F.split("."),a)))}for(let l of $.keys()){let a=l.split(".");if(!j(d,a)){let u=_.has(l)?[]:!1;E(d,a,u)}}for(let l of C.keys()){let a=l.split(".");!j(d,a)&&_.has(l)&&E(d,a,[])}return t?d["--"]=P:d._.push(...P),d}var q=n=>{let e=[],t=[],r={},s={};for(let o of n)o.type==="boolean"?e.push(o.name):t.push(o.name),o.short!==void 0&&(r[o.short]=o.name),o.default!==void 0&&(s[o.name]=o.default);return{boolean:e,string:t,alias:r,default:s}},ye=n=>n!=null&&n.constructor===String,$e={boolean:n=>!!n,number:n=>ye(n)?Number(n):n,string:n=>String(n),"string[]":n=>Array.isArray(n)?n.map(String):[String(n)]},Ce=(n,e)=>{if(n!==void 0)return $e[e]?.(n)??n},Y=(n,e)=>{let t={};for(let r of e){let s=n[r.name];t[r.name]=Ce(s,r.type)}return t};var Z=(n,e)=>{let t=[];for(let r of e)if(r.required===!0){let s=n[r.name];(s===void 0||s===""||s===!1)&&t.push(`Required flag --${r.name} is missing`)}return t};var N=(n,e)=>n+" ".repeat(Math.max(0,e-n.length)),be=n=>{let e=n.short!==void 0?`-${n.short}, `:"",t=n.type!=="boolean"?` <${n.type}>`:"";return`${e}--${n.name}${t}`},xe=(n,e)=>[n.description!==void 0?`${e} - ${n.description}`:e,""],_e=(n,e)=>{if(n.usage!==void 0)return["Usage:",` ${n.usage}`,""];let t=n.children.length>0?" <command>":"",r=n.flags.length>0?" [options]":"";return["Usage:",` ${e}${t}${r}`,""]},Fe=n=>{if(n.length===0)return[];let e=s=>s.aliases!==void 0&&s.aliases.length>0?`${s.name}, ${s.aliases.join(", ")}`:s.name,t=Math.max(...n.map(s=>e(s).length));return["Commands:",...n.map(s=>` ${N(e(s),t+2)}${s.description??""}`),""]},Me=n=>{if(n===void 0||n.length===0)return[];let e=o=>`-> "${o.join(" ")}"`,t=Math.max(...n.map(o=>o.name.length)),r=Math.max(...n.map(o=>e(o.target).length));return["Shortcuts:",...n.map(o=>` ${N(o.name,t+2)}${N(e(o.target),r+2)}${o.description}`),""]},Oe=n=>{if(n.length===0)return[];let e=n.map(s=>({flag:be(s),desc:s.description})),t=Math.max(...e.map(s=>s.flag.length));return["Options:",...e.map(({flag:s,desc:o})=>` ${N(s,t+2)}${o}`),""]},Ae=n=>n?.length?["Examples:",...n.map(e=>` ${e}`),""]:[],J=(n,e)=>{let t=e.join(" "),r=[...xe(n,t),..._e(n,t),...Fe(n.children),...Me(n.shortcuts),...Oe(n.flags),...Ae(n.examples)];return n.children.length>0&&r.push(`Run '${t} <command> --help' for more information on a command.`),r.join(`
|
|
2
|
-
`)};var K=n=>{let e=[];for(let t of n)e.push(`--${t.name}`),t.short!==void 0&&e.push(`-${t.short}`);return e.join(" ")},Q=(n,e)=>{if(n.children===void 0||n.children.length===0)return"";let t=n.children.map(i=>i.name).join(" "),r=n.flags!==void 0?K(n.flags):"",s=[t,r].filter(i=>i.length>0).join(" "),o=` ${e})
|
|
3
|
-
`;o+=` COMPREPLY=( $(compgen -W "${s}" -- "\${cur}") )
|
|
4
|
-
`,o+=` return 0
|
|
5
|
-
`,o+=` ;;
|
|
6
|
-
`;for(let i of n.children)i.children!==void 0&&i.children.length>0&&(o+=Q(i,`${e} ${i.name}`));return o},ee=(n,e)=>{let t=e.children?.map(i=>i.name).join(" ")??"",r=e.flags!==void 0?K(e.flags):"",s=[t,r].filter(i=>i.length>0).join(" "),o="";if(e.children!==void 0)for(let i of e.children)o+=Q(i,i.name);return`# ${n} bash completion
|
|
7
|
-
# Generated by @eserstack/shell/completions
|
|
8
|
-
|
|
9
|
-
_${n}_completions() {
|
|
10
|
-
local cur prev words cword
|
|
11
|
-
_init_completion || return
|
|
12
|
-
|
|
13
|
-
COMPREPLY=()
|
|
14
|
-
cur="\${COMP_WORDS[COMP_CWORD]}"
|
|
15
|
-
prev="\${COMP_WORDS[COMP_CWORD-1]}"
|
|
16
|
-
|
|
17
|
-
# Build the command path from words
|
|
18
|
-
local cmd_path=""
|
|
19
|
-
local i
|
|
20
|
-
for ((i=1; i<COMP_CWORD; i++)); do
|
|
21
|
-
case "\${COMP_WORDS[i]}" in
|
|
22
|
-
-*)
|
|
23
|
-
# Skip flags
|
|
24
|
-
;;
|
|
25
|
-
*)
|
|
26
|
-
if [[ -n "$cmd_path" ]]; then
|
|
27
|
-
cmd_path="$cmd_path \${COMP_WORDS[i]}"
|
|
28
|
-
else
|
|
29
|
-
cmd_path="\${COMP_WORDS[i]}"
|
|
30
|
-
fi
|
|
31
|
-
;;
|
|
32
|
-
esac
|
|
33
|
-
done
|
|
34
|
-
|
|
35
|
-
case "$cmd_path" in
|
|
36
|
-
${o} "")
|
|
37
|
-
COMPREPLY=( $(compgen -W "${s}" -- "\${cur}") )
|
|
38
|
-
return 0
|
|
39
|
-
;;
|
|
40
|
-
esac
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
complete -F _${n}_completions ${n}
|
|
44
|
-
`};var ne=n=>n.replace(/'/g,"'\\''"),Re=n=>{let e=[];for(let t of n){let r=ne(t.description??`${t.name} flag`);t.takesValue===!0?(e.push(`'--${t.name}=[${r}]'`),t.short!==void 0&&e.push(`'-${t.short}=[${r}]'`)):(e.push(`'--${t.name}[${r}]'`),t.short!==void 0&&e.push(`'-${t.short}[${r}]'`))}return e},Se=n=>n.map(t=>{let r=ne(t.description??t.name);return`'${t.name}:${r}'`}).join(`
|
|
45
|
-
`),te=(n,e,t)=>{let s=`${t.length===0?`_${n}`:`_${n}_${t.join("_")}`}() {
|
|
46
|
-
`;if(s+=` local -a commands
|
|
47
|
-
`,s+=` local -a flags
|
|
48
|
-
|
|
49
|
-
`,e.flags!==void 0&&e.flags.length>0){let o=Re(e.flags);s+=` flags=(
|
|
50
|
-
${o.join(`
|
|
51
|
-
`)}
|
|
52
|
-
)
|
|
53
|
-
|
|
54
|
-
`}if(e.children!==void 0&&e.children.length>0){s+=` commands=(
|
|
55
|
-
`,s+=` ${Se(e.children)}
|
|
56
|
-
`,s+=` )
|
|
57
|
-
|
|
58
|
-
`,s+=` _arguments -C \\
|
|
59
|
-
`,e.flags!==void 0&&e.flags.length>0&&(s+=' "${flags[@]}" \\\n'),s+=` '1: :->command' \\
|
|
60
|
-
`,s+=` '*::arg:->args'
|
|
61
|
-
|
|
62
|
-
`,s+=` case "$state" in
|
|
63
|
-
`,s+=` command)
|
|
64
|
-
`,s+=` _describe -t commands 'command' commands
|
|
65
|
-
`,s+=` ;;
|
|
66
|
-
`,s+=` args)
|
|
67
|
-
`,s+=' case "${words[1]}" in\n';for(let o of e.children){let i=[...t,o.name],c=`_${n}_${i.join("_")}`;s+=` ${o.name})
|
|
68
|
-
`,s+=` ${c}
|
|
69
|
-
`,s+=` ;;
|
|
70
|
-
`}s+=` esac
|
|
71
|
-
`,s+=` ;;
|
|
72
|
-
`,s+=` esac
|
|
73
|
-
`}else e.flags!==void 0&&e.flags.length>0&&(s+=' _arguments "${flags[@]}"\n');if(s+=`}
|
|
74
|
-
|
|
75
|
-
`,e.children!==void 0)for(let o of e.children)s+=te(n,o,[...t,o.name]);return s},se=(n,e)=>{let t=`#compdef ${n}
|
|
76
|
-
`;return t+=`# ${n} zsh completion
|
|
77
|
-
`,t+=`# Generated by @eserstack/shell/completions
|
|
78
|
-
|
|
79
|
-
`,t+=te(n,e,[]),t};var oe=n=>n.replace(/[\\'"$`(){}|&;<>#~*?!\^]/g,"\\$&"),ke=(n,e,t)=>{let r="";for(let s of e){let o=oe(s.description??`${s.name} flag`),i=`complete -c ${n} ${t}`;i+=` -l ${s.name}`,s.short!==void 0&&(i+=` -s ${s.short}`),s.takesValue===!0&&(i+=" -r"),i+=` -d '${o}'`,r+=i+`
|
|
80
|
-
`}return r},re=(n,e,t)=>{let r="",s;if(t.length===0?s="-n __fish_use_subcommand":s=`-n "${t.map(i=>`__fish_seen_subcommand_from ${i}`).join("; and ")}"`,e.children!==void 0&&e.children.length>0){for(let o of e.children){let i=oe(o.description??o.name);if(t.length===0)r+=`complete -c ${n} -f ${s} `,r+=`-a "${o.name}" -d '${i}'
|
|
81
|
-
`;else{let c=`-n "__fish_seen_subcommand_from ${t[t.length-1]}"`;r+=`complete -c ${n} -f ${c} `,r+=`-a "${o.name}" -d '${i}'
|
|
82
|
-
`}}for(let o of e.children)r+=re(n,o,[...t,o.name])}return e.flags!==void 0&&e.flags.length>0&&(r+=ke(n,e.flags,s)),r},ie=(n,e)=>{let t=`# ${n} fish completion
|
|
83
|
-
`;return t+=`# Generated by @eserstack/shell/completions
|
|
84
|
-
|
|
85
|
-
`,t+=`complete -c ${n} -f
|
|
86
|
-
|
|
87
|
-
`,t+=re(n,e,[]),t};var ae=(n,e,t)=>{switch(n){case"bash":return ee(e,t);case"zsh":return se(e,t);case"fish":return ie(e,t)}};var G=class n{#e;#t;#o;#g=[];#c=[];#C=[];#m=[];#l=[];#r=new Map;#b=new Map;#i=new Map;#p=new Map;#d=new Map;#n;#h;#y;#a={validation:"none"};#u;#s;constructor(e){this.#e=e}get versionString(){return this.#u}get name(){return this.#e}description(e){return this.#t=e,this}usage(e){return this.#o=e,this}example(e){return this.#g.push(e),this}aliases(...e){return this.#c=e,this}version(e){return this.#u=e,this}flag(e){return this.#C.push(e),this}persistentFlag(e){return this.#m.push({...e,persistent:!0}),this}args(e,t){return e==="exact"&&typeof t=="number"?this.#a={validation:e,count:t}:e==="min"&&typeof t=="number"?this.#a={validation:e,min:t}:e==="max"&&typeof t=="number"?this.#a={validation:e,max:t}:e==="range"&&Array.isArray(t)?this.#a={validation:e,min:t[0],max:t[1]}:this.#a={validation:e},this}command(e){return e.#s=this,this.#l.push(e),this}commands(...e){for(let t of e)this.command(t);return this}run(e){return this.#y=e,this}lazyCommand(e,t){this.#r.set(e,t);for(let r of t.aliases??[])this.#b.set(r,e);return this}group(e,t){return this.#i.set(e,t),this}groupAlias(e,t,r){return this.#i.set(e,r),this.#p.set(e,t),this}shortcut(e,t,r){let s=t.split(/\s+/).filter(Boolean);return this.#d.set(e,{target:s,description:r}),this}modules(e){return this.#n=e,this}fallback(e){return this.#h=e,this}static#M=[{name:"help",short:"h",type:"boolean",description:"Show help for this command"}];#f(){let e=[],t=this.#s;for(;t!==void 0;)e.push(...t.#m),t=t.#s;return[...n.#M,...e,...this.#m,...this.#C]}#x(){return this.#s===void 0?this:this.#s.#x()}#_(){return this.#s===void 0?[this.#e]:[...this.#s.#_(),this.#e]}#O(e){return this.#l.find(t=>t.#e===e||t.#c.includes(e))}#A(e){let{validation:t,count:r,min:s,max:o}=this.#a,i=e.length;switch(t){case"no-args":if(i>0)return"This command takes no arguments";break;case"exact":if(i!==r)return`Expected exactly ${r} argument(s), got ${i}`;break;case"min":if(i<(s??0))return`Expected at least ${s} argument(s), got ${i}`;break;case"max":if(i>(o??1/0))return`Expected at most ${o} argument(s), got ${i}`;break;case"range":if(i<(s??0)||i>(o??1/0))return`Expected ${s}-${o} arguments, got ${i}`;break}}async parse(e){let t=e??T.process.args;return await this.#$(t,[])}async#$(e,t){let r=this.#f(),s=q(r),o=this.#l.length>0||this.#r.size>0||this.#i.size>0||this.#n!==void 0||this.#d.size>0,i=z(e,{...s,stopEarly:o}),c=Y(i,r),m=i._;if(this.#u!==void 0&&c.version===!0)return console.log(`${this.#e} ${this.#u}`),S(void 0);if(c.help===!0)return console.log(this.help()),S(void 0);let p=m[0];if(p!==void 0&&o){if(this.#d.has(p)){let{target:y}=this.#d.get(p);return await this.#$([...y,...m.slice(1)],t)}let _=this.#O(p);if(_!==void 0)return await _.#$(m.slice(1),[...t,this.#e]);let O=this.#r.has(p)?p:this.#b.get(p);if(O!==void 0){let d=await this.#r.get(O).load();return d instanceof n?(d.#s=this,await d.parse(m.slice(1))):"parse"in d&&typeof d.parse=="function"?await d.parse(m.slice(1)):(console.log(d.help()),S(void 0))}if(this.#n!==void 0){let y=this.#n.aliases?.[p]??p,d=this.#n.modules[y];if(d!==void 0)return await(await d.load()).main(m.slice(1))}for(let[y,d]of this.#i)if(p===y){let g=m[1];if(g===void 0||g==="--help"||g==="-h")return this.#F(y,d),S(void 0);let P=d.aliases?.[g]??g,A=d.modules[P];return A===void 0?(console.error(`Unknown module: ${y} ${g}
|
|
88
|
-
`),this.#F(y,d),H({exitCode:1})):await(await A.load()).main(m.slice(2))}if(this.#h!==void 0)return await this.#h(p,m.slice(1))}if(this.#y===void 0)return console.log(this.help()),S(void 0);let k=Z(c,r);if(k.length>0)return H({message:k.join(`
|
|
89
|
-
`),exitCode:1});let h=this.#A(m);if(h!==void 0)return H({message:h,exitCode:1});let $=[...t,this.#e],C={args:m,flags:c,root:this.#x(),commandPath:$};return await this.#y(C)}#F(e,t){console.log(`${this.#e} ${e} - ${t.description}
|
|
90
|
-
`),console.log(`Usage: ${this.#e} ${e} <module> [options]
|
|
91
|
-
`);let r=new Map;for(let[s,o]of Object.entries(t.modules)){let i=o.category??"Modules",c=r.get(i)??[];c.push([s,o]),r.set(i,c)}for(let[s,o]of r){console.log(`${s}:`);for(let[i,c]of o)console.log(` ${i.padEnd(24)} ${c.description}`);console.log()}if(t.aliases!==void 0&&Object.keys(t.aliases).length>0){console.log("Aliases:");for(let[s,o]of Object.entries(t.aliases))console.log(` ${s.padEnd(24)} \u2192 ${o}`)}}help(){let e=[...this.#l.map(s=>({name:s.#e,aliases:s.#c.length>0?s.#c:void 0,description:s.#t,usage:s.#o,examples:s.#g,flags:s.#f(),children:[]})),...[...this.#r.entries()].map(([s,o])=>({name:s,aliases:o.aliases!==void 0&&o.aliases.length>0?[...o.aliases]:void 0,description:o.description,flags:[],children:[]})),...this.#n!==void 0?Object.entries(this.#n.modules).map(([s,o])=>({name:s,description:o.description,flags:o.flags??[],children:[]})):[],...[...this.#i.entries()].filter(([s])=>!this.#p.has(s)).map(([s,o])=>{let i=[...this.#p.entries()].filter(([c,m])=>m===s).map(([c])=>c);return{name:s,aliases:i.length>0?i:void 0,description:o.description,flags:[],children:[]}})],t=[...this.#d.entries()].map(([s,o])=>({name:s,target:o.target,description:o.description})),r={name:this.#e,description:this.#t,usage:this.#o,examples:this.#g,flags:this.#f(),children:e,shortcuts:t.length>0?t:void 0};return J(r,this.#_())}#w(){let e=r=>r.map(s=>({name:s.name,short:s.short,description:s.description,takesValue:s.type!=="boolean"})),t=r=>{let s=r.#l.map(t);for(let[o,i]of r.#r)s.push({name:o,description:i.description,children:[],flags:[]});if(r.#n!==void 0)for(let[o,i]of Object.entries(r.#n.modules))s.push({name:o,description:i.description,children:[],flags:i.flags!==void 0?e(i.flags):[]});for(let[o,i]of r.#i){let c=Object.entries(i.modules).map(([m,p])=>({name:m,description:p.description,children:[],flags:p.flags!==void 0?e(p.flags):[]}));s.push({name:o,description:i.description,children:c,flags:[]})}return{name:r.#e,description:r.#t,children:s,flags:e(r.#f())}};return t(this)}completions(e){let t=this.#w();return ae(e,this.#e,t)}};var le=class{description;#e;#t;#o=[];constructor(e){this.description=e.description,this.#e=e.modules??{},this.#t=e.aliases??{}}addSubmodule(e,t){return this.#o.push({registration:e,module:t}),this}async addSubmoduleAsync(e,t){let r=await t;return this.#o.push({registration:e,module:r}),this}toGroupOptions(){return{description:this.description,modules:this.#e,aliases:Object.keys(this.#t).length>0?this.#t:void 0}}toCommand(e,t){let r=new G(e).description(this.description);t!==void 0&&r.version(t),Object.keys(this.#e).length>0&&r.modules(this.toGroupOptions());for(let{registration:s,module:o}of this.#o){let i=o.toGroupOptions();if(r.group(s.name,i),s.aliases!==void 0)for(let c of s.aliases)r.groupAlias(c,s.name,i)}return r}};export{le as a};
|
package/chunks/chunk-CML74SNT.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as d}from"./chunk-JYVB6UAV.js";import{d as c,f as u}from"./chunk-IGDFEGCH.js";var y=async(n,t)=>{let e=t.properties?.binPath;if(e!==void 0)return e;try{let r=await u`which ${n}`.noThrow().text();if(r.length>0)return r}catch{}throw new d(`Binary "${n}" not found. Set properties.binPath in config or ensure it is on PATH.`,{provider:n})},f=(n,t,e)=>{let r=e?.stdinData!==void 0,s=new c(n,[...t],{stdin:r?"piped":"null",stdout:"piped",stderr:"piped",cwd:e?.cwd,env:e?.env}).child();if(r&&s.stdin!==null){let i=new TextEncoder,a=s.stdin.getWriter();a.write(i.encode(e.stdinData)).then(()=>{a.close()}).catch(()=>{})}if(e?.signal!==void 0){let i=e.signal;i.aborted?s.kill("SIGTERM"):i.addEventListener("abort",()=>{s.kill("SIGTERM")},{once:!0})}return{stdout:s.stdout,stderr:s.stderr,waitForExit:async()=>{let i=await s.status;return{code:i.code,success:i.success}},kill:i=>{s.kill(i??"SIGTERM")}}},l=new TextDecoder;async function*m(n){let t=n.getReader(),e="";try{let r=await t.read();for(;r.done!==!0;){e+=l.decode(r.value,{stream:!0});let s=e.split(`
|
|
2
|
-
`);e=s.pop()??"";for(let i of s){let a=i.trim();if(a.length!==0)try{yield JSON.parse(a)}catch{}}r=await t.read()}let o=e.trim();if(o.length>0)try{yield JSON.parse(o)}catch{}}finally{t.releaseLock()}}var w=async(n,t)=>{let e=n.getReader(),r=[],o=await e.read();for(;o.done!==!0;)r.push(l.decode(o.value,{stream:!0})),o=await e.read();return e.releaseLock(),{content:[{kind:"text",text:r.join("").trim()}],stopReason:"end_turn",usage:{inputTokens:0,outputTokens:0,totalTokens:0},modelId:t}},h=async n=>{let t=n.getReader(),e=[],r=await t.read();for(;r.done!==!0;)e.push(l.decode(r.value,{stream:!0})),r=await t.read();return t.releaseLock(),e.join("").trim()},x=(n,t,e)=>{if(t===0)return null;let r=e.length>0?`${n} exited with code ${t}: ${e}`:`${n} exited with code ${t}`;return t===1?new d(r,{provider:n}):t===126||t===127?new d(`${n} binary not found or not executable (exit code ${t})`,{provider:n}):new d(r,{provider:n})},b=(n,t)=>{let e=[];t!==void 0&&(e.push(t),e.push(""));for(let r of n)for(let o of r.content)o.kind==="text"&&e.push(o.text);return e.join(`
|
|
3
|
-
`)};export{y as a,f as b,m as c,w as d,h as e,x as f,b as g};
|
package/chunks/chunk-CTTMQSHF.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as d,h as i,i as u}from"./chunk-JYVB6UAV.js";import{d as l}from"./chunk-OAWYVETM.js";var y=r=>({...r,maxTokens:r.maxTokens??1024,temperature:r.temperature??.7,requestTimeoutMs:r.requestTimeoutMs??6e4});var c=r=>{let e=[];for(let o of r.content)o.kind==="text"&&e.push(o.text);return e.join("")},f=r=>l(r,c),T=r=>{let e=[];for(let o of r.content)o.kind==="tool_call"&&e.push(o.toolCall);return e},x=async(r,e="unknown")=>{let o=[],t="",s="end_turn",a={inputTokens:0,outputTokens:0,totalTokens:0};for await(let n of r)switch(n.kind){case"content_delta":{t+=n.textDelta;break}case"tool_call_delta":{n.toolCall!==void 0&&o.push({kind:"tool_call",toolCall:n.toolCall});break}case"message_done":{s=n.stopReason,a=n.usage;break}case"error":throw n.error}return t.length>0&&o.unshift({kind:"text",text:t}),{content:o,stopReason:s,usage:a,modelId:e}};var p=class{models=new Map;factories=new Map;constructor(e){if(e?.factories!==void 0)for(let o of e.factories)this.factories.set(o.provider,o)}registerFactory(e){this.factories.set(e.provider,e)}async addModel(e,o){if(this.models.has(e))throw new i(e);let t=this.factories.get(o.provider);if(t===void 0)throw new u(o.provider);let s=y(o),a=await t.createModel(s);return this.models.set(e,a),a}async removeModel(e){let o=this.models.get(e);if(o===void 0)throw new d(e);await o.close(),this.models.delete(e)}getDefault(){let e=this.models.get("default");if(e!==void 0)return e;let o=this.models.values().next();return o.done===!0?null:o.value}getNamed(e){return this.models.get(e)??null}getByProvider(e){let o=[];for(let t of this.models.values())t.provider===e&&o.push(t);return o}getByCapability(e){let o=[];for(let t of this.models.values())t.capabilities.includes(e)&&o.push(t);return o}listModels(){return[...this.models.keys()]}listRegisteredProviders(){return[...this.factories.keys()]}async loadFromConfig(e){let o=Object.entries(e.targets);for(let[t,s]of o)await this.addModel(t,s)}async close(){let e=[];for(let o of this.models.values())e.push(o.close());await Promise.all(e),this.models.clear()}};export{y as a,c as b,f as c,T as d,x as e,p as f};
|
package/chunks/chunk-DBKXMYLF.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{f as a}from"./chunk-KRKOWSYW.js";import{i as r}from"./chunk-Y5E7ZCCX.js";var m=a.eventsDir,u=a.eventsFile,w=async(c,s)=>{let i=`${c}/${a.eventsDir}`,e=`${c}/${a.eventsFile}`;await r.fs.mkdir(i,{recursive:!0});let n=JSON.stringify(s)+`
|
|
2
|
-
`,t="";try{t=await r.fs.readTextFile(e)}catch{}await r.fs.writeTextFile(e,t+n)},x=async(c,s)=>{let i=`${c}/${a.eventsFile}`,e;try{e=await r.fs.readTextFile(i)}catch{return[]}let n=e.trim().split(`
|
|
3
|
-
`).filter(t=>t.length>0).map(t=>{try{return JSON.parse(t)}catch{return null}}).filter(t=>t!==null);return s?.since!==void 0&&(n=n.filter(t=>t.ts>s.since)),n.reverse(),s?.limit!==void 0&&s.limit>0&&(n=n.slice(0,s.limit)),n},E=(c,s)=>{let i=`${c}/${a.eventsFile}`,e=0,n=!1;(async()=>{try{e=(await r.fs.stat(i)).size}catch{e=0}})();let t=setInterval(async()=>{if(!n)try{let o=await r.fs.stat(i);if(o.size<=e)return;let d=await r.fs.readTextFile(i),p=new TextEncoder().encode(d);if(p.length>e){let v=d.slice(new TextDecoder().decode(p.slice(0,e)).length).trim().split(`
|
|
4
|
-
`).filter(l=>l.length>0);for(let l of v)try{let f=JSON.parse(l);s(f)}catch{}}e=o.size}catch{}},500);return()=>{n=!0,clearInterval(t)}};export{w as a,x as b,E as c};
|
package/chunks/chunk-DEHRWREM.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var u=new Set(["log","diff","status","show","blame","rev-parse","ls-files","ls-tree","cat-file","describe","shortlog","name-rev","for-each-ref","rev-list","help","version"]),p=new Map([["branch",new Set(["","--list","-l","-a","--all","-r","--remotes","-v","--verbose","--contains","--no-contains","--merged","--no-merged","--show-current"])],["tag",new Set(["","-l","--list","-v","--verify","-n"])],["stash",new Set(["list","show"])],["remote",new Set(["","-v","--verbose","show","get-url"])],["config",new Set(["--get","--get-all","--get-regexp","--list","-l","--global","--local","--system"])],["reflog",new Set(["","show"])]]),m=new Set(["-C","-c","--git-dir","--work-tree","--namespace","--super-prefix","--config-env"]),d=new Set(["--no-replace-objects","--bare","--no-optional-locks","--literal-pathspecs","--glob-pathspecs","--noglob-pathspecs","--icase-pathspecs","--no-pager","--paginate"]),S=s=>{let e=0;for(;e<s.length;){let t=s[e];if(m.has(t)){e+=2;continue}if(d.has(t)){e+=1;continue}if(t.startsWith("--git-dir=")||t.startsWith("--work-tree=")||t.startsWith("--namespace=")||t.startsWith("--super-prefix=")||t.startsWith("--config-env=")){e+=1;continue}if(t.startsWith("-C")&&t.length>2){e+=1;continue}if(t.startsWith("-c")&&t.length>2&&t.includes("=")){e+=1;continue}return t}return null},w=s=>{let e=(s.split(/[/\\]/).pop()??s).toLowerCase();return e==="git"||e==="git.exe"},l=s=>{let e=s.trim();if(e.length===0)return!0;let t=e.split(/\s+/);if(!w(t[0]))return!0;let o=t.slice(1);if(o.length===0)return!0;let n=S(o)??"";if(u.has(n))return!0;let r=p.get(n);if(r!==void 0){let i=t.indexOf(n),c=i>=0&&i+1<t.length?t[i+1]:"";if(r.has(c))return!0}return!1};var x=s=>{let e=[],t=s.split(/&&|\|\||;|\n/);for(let o of t){let n=o.trim();if(n.length===0||!n.includes("git"))continue;let r=n.matchAll(/(?:^|[\s($`/\\])git\b/g);for(let i of r){let g=i[0].indexOf("git"),a=(i.index??0)+g,f=n.slice(a),h=(f.split(/[;&|$)`'"]/)[0]??f).trim();h.startsWith("git")&&e.push(h)}}return e},b=s=>{let e=[/(?:^|\s)(?:\S*\/)?[a-z]*sh\s+-\w*c\s+\$?["'](.+?)["']/g,/(?:^|\s)(?:\S*\/)?[a-z]*sh\s+-\w*c\s+(\S+)/g,/eval\s+["'](.+?)["']/g];for(let n of e){let r;for(;(r=n.exec(s))!==null;){let i=r[1]??"";if(i.includes("git")&&!l(i))return!0}}let t=s.split("|");for(let n of t){let r=n.trim();if(r.length>0&&!l(r))return!0}let o=s.matchAll(/(?:^|[\s($`/\\])git\b/g);for(let n of o){let i=n[0].indexOf("git"),c=(n.index??0)+i,a=(s.slice(c).split(/[;&|$)`'"]/)[0]??"").trim();if(a.startsWith("git")&&!l(a))return!0}return!1},G=s=>s.replace(/--\w+='[^']*'/g,"").replace(/--\w+="[^"]*"/g,"").replace(/--\w+=\S*/g,"");export{l as a,x as b,b as c,G as d};
|
package/chunks/chunk-EIGFDYGQ.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as k,d as T,e as x,f as R}from"./chunk-PSX63TYP.js";import{a as y,k as h}from"./chunk-JYVB6UAV.js";import{a as m,b as p}from"./chunk-OAWYVETM.js";var l=class{capabilities=["text_generation","streaming","tool_calling","vision","audio","structured_output","reasoning"];provider="vertexai";modelId;client;config;constructor(e,t){this.client=e,this.config=t,this.modelId=t.model}async generateText(e,t){let r=v(this.config,e);try{let o=await this.client.models.generateContent({model:this.config.model,...r,config:{...r.config,httpOptions:t!==void 0?{signal:t}:void 0}});return m(x(o,this.modelId))}catch(o){return p(C(o))}}async*streamText(e,t){let r=v(this.config,e);try{let o=await this.client.models.generateContentStream({model:this.config.model,...r,config:{...r.config,httpOptions:t!==void 0?{signal:t}:void 0}}),s=0,a=0;for await(let c of o){let g=c?.candidates??[];if(g.length>0){let u=g[0],S=u?.content?.parts??[];for(let i of S)i.text!==void 0&&(yield{kind:"content_delta",textDelta:i.text}),i.functionCall!==void 0&&(yield{kind:"tool_call_delta",toolCall:{id:i.functionCall.name,name:i.functionCall.name,arguments:i.functionCall.args??{}}});let d=u?.finishReason;if(d!=null){let i=c?.usageMetadata;s=i?.promptTokenCount??s,a=i?.candidatesTokenCount??a;let f="end_turn";d==="MAX_TOKENS"&&(f="max_tokens"),yield{kind:"message_done",stopReason:f,usage:{inputTokens:s,outputTokens:a,totalTokens:s+a}}}}}}catch(o){yield{kind:"error",error:C(o)}}}async close(){}getRawClient(){return this.client}},_={provider:"vertexai",async createModel(n){let{GoogleGenAI:e}=await import("./node-GQQ42DT2.js"),t={vertexai:!0,project:n.projectId,location:n.location??"us-central1"};n.apiKey!==void 0&&(t.apiKey=n.apiKey);let r=new e(t);return new l(r,n)}},v=(n,e)=>{let{contents:t,systemInstruction:r}=k(e.messages),o={maxOutputTokens:e.maxTokens??n.maxTokens};e.temperature!==void 0&&(o.temperature=e.temperature),e.topP!==void 0&&(o.topP=e.topP),e.stopWords!==void 0&&(o.stopSequences=e.stopWords),e.responseFormat!==void 0&&e.responseFormat.type==="json_schema"&&(o.responseMimeType="application/json",o.responseSchema=e.responseFormat.jsonSchema),e.thinkingBudget!==void 0&&(o.thinkingConfig={thinkingBudget:e.thinkingBudget});let s={contents:t,config:o},a=e.system??r;return a!=null&&(s.systemInstruction=a),e.tools!==void 0&&(s.tools=T(e.tools)),e.safetySettings!==void 0&&(s.safetySettings=e.safetySettings),s},C=n=>{if(n instanceof y)return n;let e=n instanceof Error?n:new Error(String(n)),t=R(n);return h("vertexai",t,e)};export{l as a,_ as b};
|
package/chunks/chunk-EIMBEXUJ.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{f as r}from"./chunk-IGDFEGCH.js";import{i}from"./chunk-Y5E7ZCCX.js";var o=async e=>{try{return await r`which ${e}`.noThrow().code()===0}catch{return!1}},s=async()=>{try{return(await fetch("http://localhost:11434/api/version",{signal:AbortSignal.timeout(1e3)})).ok}catch{return!1}},a=e=>i.env.has(e),c=async()=>{let[e,t,l,n]=await Promise.all([o("claude"),s(),o("opencode"),o("kiro")]);return[{name:"claude-code",alias:"cc",type:"CLI",available:e,detail:e?"claude binary found":"claude not on PATH"},{name:"ollama",alias:"ol",type:"HTTP",available:t,detail:t?"localhost:11434 reachable":"localhost:11434 not reachable"},{name:"opencode",alias:"oc",type:"CLI",available:l,detail:l?"opencode binary found":"opencode not on PATH"},{name:"kiro",alias:"kr",type:"CLI",available:n,detail:n?"kiro binary found":"kiro not on PATH"},{name:"anthropic",alias:"ant",type:"API",available:a("ANTHROPIC_API_KEY")||a("ANTHROPIC_AUTH_TOKEN"),detail:a("ANTHROPIC_API_KEY")?"ANTHROPIC_API_KEY set":a("ANTHROPIC_AUTH_TOKEN")?"ANTHROPIC_AUTH_TOKEN set":"ANTHROPIC_API_KEY not set"},{name:"openai",alias:"oai",type:"API",available:a("OPENAI_API_KEY"),detail:a("OPENAI_API_KEY")?"OPENAI_API_KEY set":"OPENAI_API_KEY not set"},{name:"gemini",alias:"gem",type:"API",available:a("GEMINI_API_KEY")||a("GOOGLE_API_KEY"),detail:a("GEMINI_API_KEY")||a("GOOGLE_API_KEY")?"API key set":"GEMINI_API_KEY not set"},{name:"vertexai",alias:"vtx",type:"API",available:a("GOOGLE_CLOUD_PROJECT"),detail:a("GOOGLE_CLOUD_PROJECT")?"GOOGLE_CLOUD_PROJECT set":"GOOGLE_CLOUD_PROJECT not set"}]},_=async()=>(await c()).filter(t=>t.available).map(t=>t.name);export{c as a,_ as b};
|
package/chunks/chunk-ENP4P2YH.js
DELETED
|
File without changes
|
package/chunks/chunk-FE4MKOI4.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var d=class extends Error{capability;runtimeName;constructor(t,n){super(`Capability "${t}" is not available on runtime "${n}"`),this.name="RuntimeCapabilityError",this.capability=t,this.runtimeName=n}},P=class extends Error{path;constructor(t){super(`No such file or directory: ${t}`),this.name="NotFoundError",this.path=t}},R=class extends Error{path;constructor(t){super(`File or directory already exists: ${t}`),this.name="AlreadyExistsError",this.path=t}},p=class extends Error{cmd;code;stderr;constructor(t,n,r){super(`Command "${t}" failed with exit code ${n}: ${r}`),this.name="ProcessError",this.cmd=t,this.code=n,this.stderr=r}};var c=e=>e.replace(/\\/g,"/").replace(/\/+/g,"/"),K=e=>c(e),M=(...e)=>{if(e.length===0)return".";let t=e.filter(n=>n.length>0).join("/");return t.length===0?".":y(t)},g=(...e)=>{let t="",n=!1;for(let r=e.length-1;r>=0&&!n;r--){let o=e[r];o===void 0||o.length===0||(t=`${o}/${t}`,n=E(o))}return t=c(t),t.length>1&&t.endsWith("/")&&(t=t.slice(0,-1)),y(t)??"."},v=e=>{if(e.length===0)return".";for(e=c(e);e.length>1&&e.endsWith("/");)e=e.slice(0,-1);let t=e.lastIndexOf("/");return t===-1?".":t===0?"/":e.slice(0,t)},f=(e,t)=>{if(e.length===0)return"";for(e=c(e);e.length>1&&e.endsWith("/");)e=e.slice(0,-1);let n=e.lastIndexOf("/"),r=n===-1?e:e.slice(n+1);return t&&r.endsWith(t)&&(r=r.slice(0,-t.length)),r},S=e=>{let t=f(e),n=t.lastIndexOf(".");return n<=0||n===t.length-1?"":t.slice(n)},y=e=>{if(e.length===0)return".";e=c(e);let t=e.startsWith("/"),n=e.endsWith("/"),r=e.split("/").filter(i=>i.length>0),o=[];for(let i of r)i!=="."&&(i===".."?o.length>0&&o[o.length-1]!==".."?o.pop():t||o.push(".."):o.push(i));let s=o.join("/");return t&&(s=`/${s}`),n&&s.length>1&&(s+="/"),s??"."},E=e=>e.length===0?!1:!!(e.startsWith("/")||e.length>=3&&/^[a-zA-Z]:[/\\]/.test(e)),W=(e,t)=>{if(e===t||(e=g(e),t=g(t),e===t))return"";let n=e.split("/").filter(l=>l.length>0),r=t.split("/").filter(l=>l.length>0),o=0,s=Math.min(n.length,r.length);for(let l=0;l<s&&n[l]===r[l];l++)o++;let i=n.length-o,m=r.slice(o);return[...Array(i).fill(".."),...m].join("/")??"."},I=e=>{if(e.length===0)return{root:"",dir:"",base:"",ext:"",name:""};e=c(e);let t="",n="",r=f(e),o=S(e),s=o?r.slice(0,-o.length):r;return e.startsWith("/")?t="/":/^[a-zA-Z]:[/\\]/.test(e)&&(t=e.slice(0,3)),n=v(e),n==="."&&(n=""),{root:t,dir:n,base:r,ext:o,name:s}},C=e=>{let{root:t="",dir:n,base:r,ext:o="",name:s=""}=e,i=r??s+o;return n?n===t?`${n}${i}`:`${n}/${i}`:`${t}${i}`},O={join:M,resolve:g,dirname:v,basename:f,extname:S,normalize:y,isAbsolute:E,relative:W,parse:I,format:C,sep:"/",delimiter:":"};var N=e=>{if(typeof Deno<"u"&&Deno.env?.get)return Deno.env.get(e);let t=globalThis.process;if(t?.env)return t.env[e]},x=(...e)=>{for(let t of e){let n=N(t);if(n!==void 0)return n}},T=e=>{try{let t=globalThis.require;if(t instanceof Function)return t(e)}catch{}},F=()=>globalThis.process,D=()=>globalThis.navigator,a=globalThis,U=()=>typeof a.caches<"u"&&typeof a.Request<"u"&&typeof a.Response<"u"&&typeof a.window>"u"&&typeof a.document>"u",$=()=>typeof a.window<"u"||typeof a.document<"u",u=()=>{if(typeof globalThis>"u")return"unknown";if(typeof a.Bun<"u")return"bun";if(typeof a.Deno<"u")return"deno";let e=a.process;return e?.versions?.node&&!e?.versions?.bun?"node":U()?"workerd":$()?"browser":"unknown"},j={deno:()=>a.Deno?.version?.deno??"unknown",bun:()=>a.Bun?.version??"unknown",node:()=>a.process?.versions?.node??"unknown",workerd:()=>"unknown",browser:()=>a.navigator?.userAgent??"unknown",unknown:()=>"unknown"},te=()=>j[u()](),ne=e=>u()===e,re=()=>u()==="browser",z=new Set(["deno","node","bun"]),oe=()=>z.has(u()),ie=()=>u()==="workerd",k={darwin:"darwin",linux:"linux",windows:"windows",win32:"windows"},b=()=>{if(typeof Deno<"u"&&Deno.build?.os)return k[Deno.build.os]??"linux";let e=F();if(e?.platform)return k[e.platform]??"linux";let t=D();if(t?.userAgent){let n=t.userAgent.toLowerCase();if(n.includes("mac"))return"darwin";if(n.includes("win"))return"windows";if(n.includes("linux"))return"linux"}return"linux"},A={x86_64:"amd64",x64:"amd64",aarch64:"arm64",arm64:"arm64"},_=()=>{if(typeof Deno<"u"&&Deno.build?.arch)return A[Deno.build.arch]??"amd64";let e=F();if(e?.arch)return A[e.arch]??"amd64";let t=D();if(t?.userAgent){let n=t.userAgent.toLowerCase();if(n.includes("arm64")||n.includes("aarch64"))return"arm64"}return"amd64"},L=()=>{let e=x("HOME","USERPROFILE");if(e)return e;let t=T("os");return t?.homedir?t.homedir():b()==="windows"?"C:\\Users\\Default":"/home"},B=()=>{let e=b()==="windows",t=e?x("TMP","TEMP","TMPDIR"):x("TMPDIR","TMP","TEMP");if(t)return t;let n=T("os");return n?.tmpdir?n.tmpdir():e?"C:\\Windows\\Temp":"/tmp"},se=()=>({platform:b(),arch:_(),homedir:L(),tmpdir:B()}),h=e=>e==="inherit"?"inherit":e==="piped"?"pipe":"ignore";var X=e=>({stdin:e?.stdin??"null",stdout:e?.stdout??"piped",stderr:e?.stderr??"piped"}),ae=e=>{let t=X(e);return[h(t.stdin),h(t.stdout),h(t.stderr)]};var de=(e,t)=>{let n={spawn:e,spawnChild:t,async exec(r,o=[],s){let i=await e(r,o,s);if(!i.success){let m=new TextDecoder().decode(i.stderr);throw new p(r,i.code,m)}return new TextDecoder().decode(i.stdout).trim()},async execJson(r,o=[],s){let i=await n.exec(r,o,s);return JSON.parse(i)}};return n},w=(e,t)=>()=>{throw new d(e,t)},q=e=>{let t=w("fs",e);return{readFile:t,readTextFile:t,writeFile:t,writeTextFile:t,exists:t,stat:t,lstat:t,mkdir:t,ensureDir:t,remove:t,readDir:t,copyFile:t,rename:t,makeTempDir:t,realPath:t,watch:t,walk:t,chmod:t}},J=e=>{let t=w("exec",e);return{spawn:t,exec:t,execJson:t,spawnChild:t}},V=e=>{let t=w("process",e);return{exit:t,setExitCode:t,cwd:t,chdir:t,hostname:t,execPath:t,isAlive:()=>!1,get argv(){throw new d("process",e)},get argv0(){throw new d("process",e)},get args(){throw new d("process",e)},get pid(){throw new d("process",e)},get stdin(){throw new d("process",e)},get stdout(){throw new d("process",e)},get stderr(){throw new d("process",e)},isTerminal(){return!1},setStdinRaw(){throw new d("process",e)},writeToStdout(){throw new d("process",e)},consoleSize(){return{columns:80,rows:24}}}},H=()=>({get:()=>{},set:()=>{},delete:()=>{},has:()=>!1,toObject:()=>({})}),le=e=>({name:e,version:"unknown",capabilities:{fs:!1,fsSync:!1,exec:!1,process:!1,env:!1,stdin:!1,stdout:!1,kv:!1},fs:q(e),path:O,exec:J(e),env:H(),process:V(e)});export{d as a,P as b,R as c,p as d,K as e,O as f,u as g,te as h,ne as i,re as j,oe as k,ie as l,b as m,_ as n,L as o,B as p,se as q,X as r,ae as s,de as t,q as u,J as v,V as w,H as x,le as y};
|
package/chunks/chunk-GQTHILPL.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{a as h}from"./chunk-VJRCTYGL.js";import{f as S}from"./chunk-PKEQKXZW.js";import{g as v}from"./chunk-O4KKKYCH.js";import{f as d,o as L,s as w}from"./chunk-KRKOWSYW.js";import{i as c}from"./chunk-Y5E7ZCCX.js";var b={status_quo:"scope",ambition:"scope",reversibility:"constraint",user_impact:"constraint",verification:"acceptance-criteria",scope_boundary:"out-of-scope"},R=e=>b[e]??"other",$=e=>h.find(t=>t.id===e)?.text??e,q=e=>e==="STATED"||e==="CONFIRMED"?"ratified":"inferred",I=e=>{let t=Date.parse(e);return Number.isNaN(t)?e.length>0?e:"0":String(t)},D=e=>{let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n)>>>0;return t.toString(36)},l=e=>e.lastCalledAt??new Date().toISOString(),x=e=>{let t=[];return e.involvesWebUI&&t.push("involvesWebUI"),e.involvesCLI&&t.push("involvesCLI"),e.involvesPublicAPI&&t.push("involvesPublicAPI"),e.involvesMigration&&t.push("involvesMigration"),e.involvesDataHandling&&t.push("involvesDataHandling"),t.sort()},T=e=>e.id.startsWith("decision-split-keep")?"scope":/^d\d+$/.test(e.id)?"dependency":"other",A=e=>{switch(e){case"SPEC_PROPOSAL":return"scope";case"DISCOVERY":return"scope";case"SPEC_APPROVED":return"acceptance-criteria";case"COMPLETED":return"acceptance-criteria";case"BLOCKED":return"dependency";default:return"sequencing"}},E=e=>e.discovery.answers.map(t=>{let n=t,o=n.type??"original",r=n.timestamp!==void 0&&n.timestamp.length>0?I(n.timestamp):D(t.answer);return{id:`ans:${t.questionId}:${o}:${r}`,state:e.phase,category:R(t.questionId),question:$(t.questionId),resolution:t.answer,provenance:q(n.source),timestamp:n.timestamp!==void 0&&n.timestamp.length>0?n.timestamp:l(e),artifacts:[]}}),O=e=>e.decisions.map(t=>({id:`dec:${t.id}`,state:e.phase,category:T(t),question:t.question,resolution:t.choice,provenance:"ratified",timestamp:t.timestamp.length>0?t.timestamp:l(e),artifacts:[]})),N=e=>(e.transitionHistory??[]).map(t=>({id:`tr:${t.from}:${t.to}:${I(t.timestamp)}`,state:t.to,category:A(t.to),question:`Transition ${t.from} \u2192 ${t.to}`,resolution:t.reason??`${t.from} \u2192 ${t.to} approved`,provenance:"ratified",timestamp:t.timestamp.length>0?t.timestamp:l(e),artifacts:e.specState.path!==null?[e.specState.path]:[]})),M=(e,t)=>{let n=e.discovery.refinement?.reviewPosture;if(n===void 0)return[];let o=t?.defaultReviewPosture!==void 0&&t.defaultReviewPosture===n;return[{id:`posture:${n}`,state:e.phase,category:"scope",question:"Review posture for spec refinement",resolution:n,provenance:o?"default":"ratified",timestamp:l(e),artifacts:[]}]},k=e=>{let t=e.classification;if(t===null)return[];let n=x(t),o=n.length>0?n.join(", "):"none";return[{id:`class:${n.length>0?n.join(","):"none"}`,state:e.phase,category:"constraint",question:"Spec classification (UI / CLI / API / migration / data handling)",resolution:o,provenance:t.source==="confirmed"||t.source==="manual"?"ratified":"inferred",timestamp:l(e),artifacts:[]}]},U=e=>(e.customACs??[]).map(t=>({id:`ac:${t.id}`,state:t.addedInPhase,category:"acceptance-criteria",question:"Acceptance criterion",resolution:t.text,provenance:"ratified",timestamp:t.timestamp.length>0?t.timestamp:l(e),artifacts:[]})),C=(e,t)=>[...E(e),...O(e),...N(e),...M(e,t),...k(e),...U(e)],Q=(e,t,n)=>{let o=new Set(C(e,n).map(r=>r.id));return C(t,n).filter(r=>!o.has(r.id))},V=(e,t=0)=>{let n=0;n+=(e.discovery.followUps??[]).filter(r=>r.status==="pending").length;let o=S(e.specState);if(n+=o.unresolvedSections.length+o.pendingDecisions.length,n+=(e.execution.confidenceFindings??[]).filter(r=>r.confidence<5).length,e.phase!=="IDLE"&&e.phase!=="UNINITIALIZED"&&e.phase!=="COMPLETED"){let r=new Set(e.discovery.answers.map(i=>i.questionId));n+=h.filter(i=>!r.has(i.id)).length}return n+=t,n},J=(e,t,n)=>{let o={ratified:0,inferred:0,default:0};for(let s of t)o[s.provenance]+=1;let r=new Set;for(let s of e.execution.modifiedFiles)r.add(s);for(let s of e.execution.completedTasks)r.add(s);for(let s of t)for(let p of s.artifacts)r.add(p);e.specState.path!==null&&r.add(e.specState.path);let i=e.discovery.answers.some(s=>s.questionId==="verification"&&s.answer.trim().length>0),g=e.discovery.answers.some(s=>s.questionId==="scope_boundary"&&s.answer.trim().length>0),u=(e.customACs?.length??0)>0||i||t.some(s=>s.category==="acceptance-criteria"),f=g||t.some(s=>s.category==="out-of-scope");return{resolved_decisions:t.length,provenance_breakdown:o,open_questions:n,specificity:{named_artifacts_count:r.size,acceptance_criteria_present:u,out_of_scope_present:f}}},z=(e,t)=>({schemaVersion:"measurement-report/v1",specId:e,title:`${e} (live ledger)`,guided:{decisions:t.map(n=>({id:n.id,category:n.category,question:n.question,resolution:n.resolution,provenance:n.provenance,phase:n.state}))}}),j=async(e,t)=>{let n=`${e}/${d.ledgerFile(t)}`,o;try{o=await c.fs.readTextFile(n)}catch{return[]}return o.trim().split(`
|
|
2
|
-
`).filter(r=>r.length>0).map(r=>{try{return JSON.parse(r)}catch{return null}}).filter(r=>r!==null)},G=async(e,t)=>{let n=`${e}/${d.ledgerSummaryFile(t)}`;try{let o=await c.fs.readTextFile(n);return JSON.parse(o)}catch{return null}},K=async(e,t,n,o)=>{try{let r=n.spec??t.spec;if(r===null||r.length===0)return;let i=o??null;if(i===null)try{i=await L(e)}catch{i=null}let g=Q(t,n,i),u=await j(e,r),f=new Set(u.map(a=>a.id)),s=g.filter(a=>!f.has(a.id));try{await c.fs.mkdir(`${e}/${d.ledgerRunDir(r)}`,{recursive:!0})}catch{}if(s.length>0)try{let a=`${e}/${d.ledgerFile(r)}`,m="";try{m=await c.fs.readTextFile(a)}catch{}let y=s.map(_=>JSON.stringify(_)).join(`
|
|
3
|
-
`)+`
|
|
4
|
-
`;await c.fs.writeTextFile(a,m+y)}catch{}let p=0;try{let a=await w(e),m=i===null?[]:a.filter(y=>i.concerns.includes(y.id));p=v(m).length}catch{p=0}let P=[...u,...s],F=J(n,P,V(n,p));try{await c.fs.writeTextFile(`${e}/${d.ledgerSummaryFile(r)}`,JSON.stringify(F,null,2)+`
|
|
5
|
-
`)}catch{}}catch{}};export{Q as a,V as b,J as c,z as d,j as e,G as f,K as g};
|
package/chunks/chunk-IFE5SYGK.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{f as e}from"./chunk-Y5E7ZCCX.js";var n={command:"eser",devCommand:"deno task cli",npmPackage:"eser",jsrPackage:"@eserstack/cli"},r="npx eser@latest noskills",t=r,i=s=>{t=s},a=()=>t,m=s=>`${t} ${s}`,c=async()=>await e(n,["noskills","nos"])??r;export{i as a,a as b,m as c,c as d};
|
package/chunks/chunk-IGDFEGCH.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as b,b as g}from"./chunk-575Y3OEG.js";import{i as N,j as A}from"./chunk-Y5E7ZCCX.js";import{m as k}from"./chunk-FE4MKOI4.js";var v=class extends Error{command;code;stderr;constructor(t,r,s,n){super(t),this.name="CommandError",this.command=r,this.code=s,this.stderr=n}};var $=async()=>{await b();let e=g();if(e===null)throw new Error("@eserstack/ajan native library is not available \u2014 EserAjanShellExec* requires FFI or command-mode WASM");return e},j=e=>{let t=new Uint8Array(e.reduce((s,n)=>s+n.length,0)),r=0;for(let s of e)t.set(s,r),r+=s.length;return t},L=async e=>{let t=[],r=e.getReader();try{for(;;){let{done:s,value:n}=await r.read();if(s)break;n&&t.push(n)}}finally{r.releaseLock()}return t},R=(e,t)=>{let r=JSON.parse(e.symbols.EserAjanShellExecSpawn(JSON.stringify({command:t.command,args:t.args??[],cwd:t.cwd??"",env:t.env??[]})));if(r.error!==void 0)throw new Error(r.error);let s=r.handle,n=r.pid,o=!1,a=()=>o?-1:(o=!0,JSON.parse(e.symbols.EserAjanShellExecClose(s)).code??-1),p,u=new Promise(i=>{p=i}),c,y,f=!1,C=i=>{f||(f=!0,p({success:i===0,code:i}),c.close(),y.close())},S=()=>{if(f)return;let i=e.symbols.EserAjanShellExecRead(s);if(i==="null"){C(a());return}let m=JSON.parse(i);if(m.error!==void 0){if(f)return;f=!0;let E=new Error(m.error);c.error(E),y.error(E);return}let w=Uint8Array.from(atob(m.chunk??""),E=>E.charCodeAt(0));m.stream==="stderr"?y.enqueue(w):c.enqueue(w)},l=new ReadableStream({start(i){c=i},pull(){S()}}),h=new ReadableStream({start(i){y=i},pull(){S()}}),d=new WritableStream({write(i){let m=btoa(String.fromCharCode(...i)),w=JSON.parse(e.symbols.EserAjanShellExecWrite(JSON.stringify({handle:s,data:m})));if(w.error!==void 0)throw new Error(w.error)}});return{pid:n,stdin:d,stdout:l,stderr:h,status:u,async output(){let[i,m]=await Promise.all([L(l),L(h)]);return{...await u,stdout:j(i),stderr:j(m)}},kill(i){let m=a();C(m)}}},B=async e=>{let t=await $();return R(t,e)};var I=new TextEncoder,P=new TextDecoder,U=e=>e!==void 0?Object.entries(e).map(([t,r])=>`${t}=${r}`):void 0,x=class e{#e;#r;#t;constructor(t,r=[],s={}){this.#e=t,this.#r=r,this.#t={throwOnError:!0,stdout:"piped",stderr:"piped",...s}}cwd(t){return new e(this.#e,this.#r,{...this.#t,cwd:t})}env(t,r){let s=this.#t.env??{},n;return typeof t=="string"&&r!==void 0?n={...s,[t]:r}:t!==null&&typeof t=="object"?n={...s,...t}:n=s,new e(this.#e,this.#r,{...this.#t,env:n})}stdin(t){return new e(this.#e,this.#r,{...this.#t,stdin:t})}stdinText(t){return new e(this.#e,this.#r,{...this.#t,stdin:"piped",stdinText:t})}stdout(t){return new e(this.#e,this.#r,{...this.#t,stdout:t})}stderr(t){return new e(this.#e,this.#r,{...this.#t,stderr:t})}timeout(t){return new e(this.#e,this.#r,{...this.#t,timeout:t})}noThrow(){return new e(this.#e,this.#r,{...this.#t,throwOnError:!1})}quiet(){return new e(this.#e,this.#r,{...this.#t,stdout:"null",stderr:"null"})}printCommand(){let t=[this.#e,...this.#r].join(" ");return console.log(`$ ${t}`),this}async spawn(){if(!(this.#t.stdin==="piped"||this.#t.stdin==="inherit"||this.#t.stdout==="inherit"||this.#t.stderr==="inherit")){await b();let n=g();if(n!==null)try{let o=n.symbols.EserAjanShellExec(JSON.stringify({command:this.#e,args:this.#r,cwd:this.#t.cwd,env:U(this.#t.env),timeout:this.#t.timeout!==void 0?`${this.#t.timeout}ms`:void 0})),a=JSON.parse(o);if(!a.error){let p=I.encode(a.stdout),u=I.encode(a.stderr),c={code:a.code,success:a.code===0,stdout:p,stderr:u};if(!c.success&&this.#t.throwOnError===!0)throw new v(`Command failed with exit code ${c.code}: ${this.#e}`,this.#e,c.code,a.stderr);return c}}catch(o){if(o instanceof v)throw o}}let{runtime:r}=A,s=await r.exec.spawn(this.#e,this.#r,{cwd:this.#t.cwd,env:this.#t.env,stdin:this.#t.stdin,stdinText:this.#t.stdinText,stdout:this.#t.stdout,stderr:this.#t.stderr,signal:this.#t.timeout!==void 0?AbortSignal.timeout(this.#t.timeout):void 0});if(!s.success&&this.#t.throwOnError===!0){let n=P.decode(s.stderr);throw new v(`Command failed with exit code ${s.code}: ${this.#e}`,this.#e,s.code,n)}return s}async text(t="stdout"){let r=await this.spawn();switch(t){case"stdout":return P.decode(r.stdout).trim();case"stderr":return P.decode(r.stderr).trim();case"combined":return(P.decode(r.stdout)+P.decode(r.stderr)).trim()}}async json(){let t=await this.text();return JSON.parse(t)}async lines(){let t=await this.text();return t===""?[]:t.split(`
|
|
2
|
-
`)}async bytes(){return(await this.spawn()).stdout}async code(){return(await this.noThrow().spawn()).code}pipe(t){throw new Error("exec(...).pipe() is not implemented. It previously discarded the upstream output instead of writing it to the next command's stdin, so results were silently wrong. Build the pipeline with .child() and pipe the streams yourself: const a = exec`...`.child(); const b = exec`...`.child(); await a.stdout.pipeTo(b.stdin);")}child(){let t=g();if(t===null)throw new Error("@eserstack/ajan native library is not available \u2014 exec.child() requires FFI or command-mode WASM");let r=U(this.#t.env);return R(t,{command:this.#e,args:this.#r,cwd:this.#t.cwd,env:r})}};var O=(e,t)=>{let r=[];for(let n=0;n<e.length;n++){let o=e[n];if(o!==void 0&&r.push(o),n<t.length){let a=t[n];Array.isArray(a)?r.push(a.map(p=>G(String(p))).join(" ")):a!=null&&r.push(G(String(a)))}}let s=r.join("").trim();return D(s)},G=e=>e===""?"''":/[\s"'\\$`]/.test(e)?`'${e.replace(/'/g,"'\\''")}'`:e,D=e=>{let t=[],r="",s=!1,n=!1,o=!1,a=!1;for(let u=0;u<e.length;u++){let c=e[u];if(o){r+=c,o=!1;continue}if(c==="\\"&&!s){o=!0;continue}if(c==="'"&&!n){s=!s,a=!0;continue}if(c==='"'&&!s){n=!n,a=!0;continue}if(c===" "&&!s&&!n){a&&(t.push(r),r="",a=!1);continue}r+=c,a=!0}a&&t.push(r);let p=t[0];return p===void 0?["",[]]:[p,t.slice(1)]};var F=(e,...t)=>{let[r,s]=O(e,t);return new x(r,s)};var W=async()=>{await b();let e=g();if(e===null)throw new Error("@eserstack/ajan native library is not available \u2014 EserAjanShellPty* requires FFI or command-mode WASM");return e},q=e=>{let t="";for(let r of e)t+=String.fromCharCode(r);return btoa(t)},z=e=>Uint8Array.from(atob(e),t=>t.charCodeAt(0)),M=async e=>{let t=await W(),r=Object.entries({...e.env,TERM:"xterm-256color",COLUMNS:String(e.cols??80),LINES:String(e.rows??24)}).map(([d,i])=>`${d}=${i}`),s=JSON.parse(t.symbols.EserAjanShellPtySpawn(JSON.stringify({command:e.command,args:e.args??[],cwd:e.cwd??"",env:r,cols:e.cols??80,rows:e.rows??24})));if(s.error!==void 0)throw new Error(s.error);let n=s.handle,o=s.pid??-1,a=new TextDecoder,p=new TextEncoder,u=[],c=!1,y,f=new Promise(d=>{y=d}),C=()=>{if(c)return;c=!0;let d=a.decode();if(d.length>0)for(let m of u)m(d);let i=-1;try{i=JSON.parse(t.symbols.EserAjanShellPtyClose(n)).code??-1}catch{}y(i)},S=async()=>{try{for(;;){let d=await t.symbols.EserAjanShellPtyRead(n);if(d==="null")break;let i;try{i=JSON.parse(d)}catch{break}if(i.error!==void 0)break;if(i.chunk!==void 0&&i.chunk.length>0){let m=a.decode(z(i.chunk),{stream:!0});for(let w of u)w(m)}}}finally{C()}},l=!1,h=()=>{l||(l=!0,S())};return{onData(d){u.push(d),h()},write(d){try{t.symbols.EserAjanShellPtyWrite(JSON.stringify({handle:n,data:q(p.encode(d))}))}catch{}},resize(d,i){try{t.symbols.EserAjanShellPtyResize(JSON.stringify({handle:n,cols:d,rows:i}))}catch{}},kill(d){try{t.symbols.EserAjanShellPtyKill(JSON.stringify({handle:n,signal:d??"SIGTERM"}))}catch{}h()},get pid(){return o},get exitCode(){return f}}};var K=/\x04/g,Q=/^Script (started|done),? ?(output file is )?[^\n]*\n?/gm,H=/^script: tcgetattr[^\n]*\n?/gm,Y=e=>e.replace(K,"").replace(Q,"").replace(H,""),_=(e,t)=>{let r=k();if(r==="darwin"){let s=t.map(o=>`'${o.replace(/'/g,"'\\''")}'`);return{cmd:"sh",args:["-c",`script -q /dev/null ${[e,...s].join(" ")} 2>/dev/null`],usesScript:!0}}return r==="linux"?{cmd:"sh",args:["-c",`script -qc '${(t.length>0?`${e} ${t.map(n=>`'${n.replace(/'/g,"'\\''")}'`).join(" ")}`:e).replace(/'/g,"'\\''")}' /dev/null 2>/dev/null`],usesScript:!0}:{cmd:e,args:t,usesScript:!1}},X=async e=>{let t;try{t=N.env.get("ESERSTACK_PTY")}catch{}let r=!1;if(t!=="script")try{await b(),r=g()!==null}catch{r=!1}return r?await M(e):Z(e)},Z=async e=>{let{runtime:t}=A,r=e.args!==void 0?[...e.args]:[],s=_(e.command,r),n={...e.env,TERM:"xterm-256color",COLUMNS:String(e.cols??80),LINES:String(e.rows??24)},o=t.exec.spawnChild(s.cmd,[...s.args],{cwd:e.cwd,env:n,stdin:"piped",stdout:"piped",stderr:"piped"}),a=new TextDecoder,p=new TextEncoder,u=[],c=!1,y=l=>{let h=s.usesScript?Y(l):l;if(h.length!==0)for(let d of u)d(h)},f=async l=>{let h=l.getReader();try{for(;;){let{done:d,value:i}=await h.read();if(d)break;y(a.decode(i))}}catch{}finally{h.releaseLock()}},C=()=>{c||(c=!0,o.stdout&&f(o.stdout),o.stderr&&f(o.stderr))},S=null;return o.stdin&&(S=o.stdin.getWriter()),{onData(l){u.push(l),C()},write(l){S?.write(p.encode(l)).catch(()=>{})},resize(l,h){},kill(l){try{o.kill(l==="SIGKILL"?"SIGKILL":"SIGTERM")}catch{}},get pid(){return o.pid},get exitCode(){return o.status.then(l=>l.code)}}};var T=class{#e=new Map;get size(){return this.#e.size}add(t,r){let s={id:t,process:r,active:!0};return this.#e.set(t,s),r.exitCode.then(()=>{s.active=!1}).catch(()=>{s.active=!1}),s}get(t){return this.#e.get(t)}remove(t){let r=this.#e.get(t);return r===void 0?!1:(r.active&&r.process.kill(),this.#e.delete(t),!0)}list(){return[...this.#e.values()]}async killAll(t="SIGTERM"){for(let n of this.#e.values())n.active&&n.process.kill(t);let r=3e3,s=Date.now();for(let n of this.#e.values())if(n.active){let o=r-(Date.now()-s);o>0&&await Promise.race([n.process.exitCode,new Promise(a=>setTimeout(a,o))])}}forceKillAll(){for(let t of this.#e.values())t.active&&(t.process.kill("SIGKILL"),t.active=!1);this.#e.clear()}};export{v as a,R as b,B as c,x as d,O as e,F as f,X as g,T as h};
|
package/chunks/chunk-JL3MAFYQ.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as S,b as p,c as v,d as w,e as g,f as m,g as f}from"./chunk-CML74SNT.js";import{a as l}from"./chunk-JYVB6UAV.js";import{a as h,b as k}from"./chunk-OAWYVETM.js";var y=class{capabilities=["text_generation","streaming"];provider="opencode";modelId;binary;config;constructor(e,r){this.binary=e,this.config=r,this.modelId=r.model}async generateText(e,r){let o=T(this.config,e,"json"),i=f(e.messages,e.system),s=p(this.binary,o,{signal:r,stdinData:i}),c=g(s.stderr),t=await w(s.stdout,this.modelId),u=await s.waitForExit(),a=await c,d=m("opencode",u.code,a);return d!==null?k(d):h(t)}async*streamText(e,r){let o=T(this.config,e,"stream-json"),i=f(e.messages,e.system),s=p(this.binary,o,{signal:r,stdinData:i}),c=g(s.stderr);try{for await(let d of v(s.stdout)){let x=E(d);x!==null&&(yield x)}let t=await s.waitForExit(),u=await c,a=m("opencode",t.code,u);a!==null&&(yield{kind:"error",error:a})}catch(t){t instanceof l?yield{kind:"error",error:t}:yield{kind:"error",error:new l(t instanceof Error?t.message:String(t),{provider:"opencode",cause:t instanceof Error?t:void 0})}}}close(){return Promise.resolve()}getRawClient(){return null}},_={provider:"opencode",async createModel(n){let e=await S("opencode",n);return new y(e,n)}},T=(n,e,r)=>{let o=["--output-format",r];o.push("--model",n.model),e.maxTokens!==void 0&&o.push("--max-tokens",String(e.maxTokens));let i=n.properties?.args;return i!==void 0&&o.push(...i),o},E=n=>{if(n===null||typeof n!="object")return null;let e=n;if(e.type==="content_block_delta"||e.type==="assistant"){let r=e.delta?.text??e.message?.content?.[0]?.text;return r!==void 0?{kind:"content_delta",textDelta:r}:null}return e.type==="result"||e.done===!0?{kind:"message_done",stopReason:"end_turn",usage:{inputTokens:e.usage?.input_tokens??0,outputTokens:e.usage?.output_tokens??0,totalTokens:(e.usage?.input_tokens??0)+(e.usage?.output_tokens??0)}}:e.type==="error"?{kind:"error",error:new l(e.error?.message??"Unknown OpenCode error",{provider:"opencode"})}:e.content!==void 0&&typeof e.content=="string"?{kind:"content_delta",textDelta:e.content}:null};export{y as a,_ as b};
|
package/chunks/chunk-JYVB6UAV.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var t=class extends Error{provider;statusCode;constructor(e,r){super(e,{cause:r?.cause}),this.name="AiError",this.provider=r?.provider??null,this.statusCode=r?.statusCode??null}},i=class extends t{constructor(e,r){super(e,{...r,statusCode:r?.statusCode??429}),this.name="RateLimitedError"}},o=class extends t{constructor(e,r){super(e,{...r,statusCode:r?.statusCode??401}),this.name="AuthFailedError"}},u=class extends t{constructor(e,r){super(e,{...r,statusCode:r?.statusCode??402}),this.name="InsufficientCreditsError"}},a=class extends t{constructor(e,r){super(e,{...r,statusCode:r?.statusCode??400}),this.name="BadRequestError"}},c=class extends t{constructor(e,r){super(e,{...r,statusCode:r?.statusCode??503}),this.name="ServiceUnavailableError"}},p=class extends t{constructor(e){super(`Model "${e}" not found in registry`),this.name="ModelNotFoundError"}},f=class extends t{constructor(e){super(`Model "${e}" already exists in registry`),this.name="ModelAlreadyExistsError"}},x=class extends t{constructor(e){super(`No factory registered for provider "${e}"`),this.name="UnsupportedProviderError"}},E=s=>s===429?i:s===401?o:s===402?u:s===400?a:s===500||s===503||s===529?c:null,m=(s,e,r)=>{let n=E(e);return n!==null?new n(r.message,{provider:s,statusCode:e,cause:r}):new t(r.message,{provider:s,statusCode:e,cause:r})},g={rate_limited:i,auth_failed:o,insufficient_credits:u,bad_request:a,service_unavailable:c},y=(s,e,r,n)=>{let d=n!==void 0&&n>0?n:void 0,l=r===void 0?void 0:g[r];return l===void 0?new t(e,{provider:s,statusCode:d}):new l(e,{provider:s,statusCode:d})};export{t as a,i as b,o as c,u as d,a as e,c as f,p as g,f as h,x as i,E as j,m as k,y as l};
|
package/chunks/chunk-KJLEPI7T.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as o}from"./chunk-Z7OYXH3J.js";var d=(e,n)=>{if(e!==void 0)for(let r of e){if(r==="--agent")return"agent";if(r==="--human")return"human"}let t=n?.agentMode;return t===!0?"agent":t===!1?"human":o()};var u=e=>e===void 0?[]:e.filter(n=>n!=="--agent"&&n!=="--human"&&n!=="--non-interactive");export{d as a,u as b};
|
package/chunks/chunk-KMLNG3EC.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as k,d as T,e as C,f as R}from"./chunk-PSX63TYP.js";import{a as y,k as h}from"./chunk-JYVB6UAV.js";import{a as u,b as p}from"./chunk-OAWYVETM.js";var l=class{capabilities=["text_generation","streaming","tool_calling","vision","audio","structured_output","reasoning"];provider="gemini";modelId;client;config;constructor(e,t){this.client=e,this.config=t,this.modelId=t.model}async generateText(e,t){let a=S(this.config,e);try{let n=await this.client.models.generateContent({model:this.config.model,...a,config:{...a.config,httpOptions:t!==void 0?{signal:t}:void 0}});return u(C(n,this.modelId))}catch(n){return p(x(n))}}async*streamText(e,t){let a=S(this.config,e);try{let n=await this.client.models.generateContentStream({model:this.config.model,...a,config:{...a.config,httpOptions:t!==void 0?{signal:t}:void 0}}),r=0,i=0;for await(let c of n){let g=c?.candidates??[];if(g.length>0){let f=g[0],w=f?.content?.parts??[];for(let s of w)s.text!==void 0&&(yield{kind:"content_delta",textDelta:s.text}),s.functionCall!==void 0&&(yield{kind:"tool_call_delta",toolCall:{id:s.functionCall.name,name:s.functionCall.name,arguments:s.functionCall.args??{}}});let d=f?.finishReason;if(d!=null){let s=c?.usageMetadata;r=s?.promptTokenCount??r,i=s?.candidatesTokenCount??i;let m="end_turn";d==="MAX_TOKENS"&&(m="max_tokens"),yield{kind:"message_done",stopReason:m,usage:{inputTokens:r,outputTokens:i,totalTokens:r+i}}}}}}catch(n){yield{kind:"error",error:x(n)}}}async close(){}getRawClient(){return this.client}},_={provider:"gemini",async createModel(o){let{GoogleGenAI:e}=await import("./node-GQQ42DT2.js"),t=new e({apiKey:o.apiKey});return new l(t,o)}},S=(o,e)=>{let{contents:t,systemInstruction:a}=k(e.messages),n={maxOutputTokens:e.maxTokens??o.maxTokens};e.temperature!==void 0&&(n.temperature=e.temperature),e.topP!==void 0&&(n.topP=e.topP),e.stopWords!==void 0&&(n.stopSequences=e.stopWords),e.responseFormat!==void 0&&e.responseFormat.type==="json_schema"&&(n.responseMimeType="application/json",n.responseSchema=e.responseFormat.jsonSchema),e.thinkingBudget!==void 0&&(n.thinkingConfig={thinkingBudget:e.thinkingBudget});let r={contents:t,config:n},i=e.system??a;return i!=null&&(r.systemInstruction=i),e.tools!==void 0&&(r.tools=T(e.tools)),e.safetySettings!==void 0&&(r.safetySettings=e.safetySettings),r},x=o=>{if(o instanceof y)return o;let e=o instanceof Error?o:new Error(String(o)),t=R(o);return h("gemini",t,e)};export{l as a,_ as b};
|