alran 0.9.0 → 1.0.1
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/ALRAN_TOOLS_NOTICES.md +11 -0
- package/README.md +11 -16
- package/assets/agents/alran/skills/alran-code-product/SKILL.md +3 -3
- package/assets/agents/alran/skills/alran-code-product/references/account-models.md +19 -16
- package/chunks/{account-commands-JZ6NXTTK.js → account-commands-GW7N3MYC.js} +1 -1
- package/chunks/{anthropic-MN33DP4E.js → anthropic-63VE6MAE.js} +1 -1
- package/chunks/{application-ITGAJ4HC.js → application-WPPTE6LU.js} +1 -1
- package/chunks/{auth-command-V3RVPLZO.js → auth-command-36RMNQZW.js} +1 -1
- package/chunks/azure-openai-responses-OIP3KVKJ.js +2 -0
- package/chunks/chunk-2K5H5GA7.js +2 -0
- package/chunks/chunk-3GGKARES.js +2 -0
- package/chunks/chunk-5RIMHTEU.js +207 -0
- package/chunks/{chunk-EYK25HWR.js → chunk-5Y76VFHY.js} +1 -1
- package/chunks/{chunk-QIN5ZBE2.js → chunk-6DOVXX7W.js} +1 -1
- package/chunks/{chunk-E3GLGDGC.js → chunk-6PFI65C6.js} +1 -1
- package/chunks/{chunk-4PDIO3M6.js → chunk-6UXSIWCB.js} +1 -1
- package/chunks/{chunk-OQNU3VPS.js → chunk-C6LAAFG2.js} +2 -2
- package/chunks/{chunk-33CNY6GP.js → chunk-CUG7F2FN.js} +1 -1
- package/chunks/chunk-DFMYLGVU.js +249 -0
- package/chunks/{chunk-IIE366LR.js → chunk-G5MOGPZ3.js} +490 -485
- package/chunks/{chunk-FC4M2B7E.js → chunk-IC6A323Q.js} +1 -1
- package/chunks/{chunk-4X22UJQH.js → chunk-IN2Z5SSJ.js} +1 -1
- package/chunks/chunk-JSTSFMGK.js +70 -0
- package/chunks/{chunk-WWNUAU4P.js → chunk-LCC45PCZ.js} +1 -1
- package/chunks/{chunk-7QLAXRD2.js → chunk-MPQ6G7LH.js} +254 -254
- package/chunks/{chunk-FUERW2DW.js → chunk-MUXNNOSQ.js} +1 -1
- package/chunks/{chunk-44VPC5LA.js → chunk-NBONSNQZ.js} +1 -1
- package/chunks/chunk-NMKRNU5O.js +2 -0
- package/chunks/chunk-NVPGGFT3.js +2 -0
- package/chunks/chunk-NZXJAHTO.js +9 -0
- package/chunks/{chunk-6255CZPL.js → chunk-PCL2CVVE.js} +1 -1
- package/chunks/chunk-PXH4SBCS.js +3 -0
- package/chunks/chunk-RLJVY75P.js +28 -0
- package/chunks/{chunk-WYANV3IX.js → chunk-RLND4AYL.js} +1 -1
- package/chunks/chunk-TJC4LPRQ.js +2 -0
- package/chunks/chunk-U4PFHJ7Z.js +27 -0
- package/chunks/chunk-V2SB4U4D.js +2 -0
- package/chunks/chunk-VGKKKM2W.js +6 -0
- package/chunks/{chunk-XFCC2CI2.js → chunk-VUISZDXX.js} +1 -1
- package/chunks/chunk-XVGPB7TW.js +21 -0
- package/chunks/{chunk-CJM7ZJ6W.js → chunk-ZDI22NOK.js} +1 -1
- package/chunks/{data-dir-LDVKDCJ2.js → data-dir-OEPRRIOO.js} +1 -1
- package/chunks/{dist-2BRD4JFU.js → dist-VKYZJYR6.js} +1 -1
- package/chunks/{dist-EXKHRFQO.js → dist-WGTMUM3E.js} +1 -1
- package/chunks/{ffi-OUPK6AY6.js → ffi-EFLUAAVX.js} +1 -1
- package/chunks/{ffi-M5UP5J6C.js → ffi-QKKA5HYI.js} +1 -1
- package/chunks/{google-UJAPMFAB.js → google-RCR46TTQ.js} +1 -1
- package/chunks/{google-vertex-VLSF55PW.js → google-vertex-Y26T7YYR.js} +1 -1
- package/chunks/{install-source-JTIUC4G4.js → install-source-63OVVBMK.js} +1 -1
- package/chunks/launcher-2UG3JPYF.js +63 -0
- package/chunks/lifecycle-5IPJRP2V.js +2 -0
- package/chunks/{main-TQGGRHTS.js → main-7SGOQBHZ.js} +2 -2
- package/chunks/{mistral-ZJZUEF2X.js → mistral-NEBDKUEI.js} +1 -1
- package/chunks/{module-6F3E5H7Y-BN7QWGYB.js → module-6F3E5H7Y-FIMLNSCK.js} +1 -1
- package/chunks/{module-asyncify-R6PWJ6ZV-P4FWSBAY.js → module-asyncify-R6PWJ6ZV-Q2HJ3NOC.js} +1 -1
- package/chunks/{multipart-parser-L6M455MS.js → multipart-parser-JVSLI2CL.js} +1 -1
- package/chunks/{network-proxy-U72JCK2I.js → network-proxy-AJO7ZW3O.js} +1 -1
- package/chunks/openai-codex-responses-L2CIGCKO.js +2 -0
- package/chunks/openai-completions-C4PHW6MD.js +2 -0
- package/chunks/openai-responses-5NVFOW4Y.js +2 -0
- package/chunks/{openrouter-G2EHY5BD.js → openrouter-BKUGQT7Z.js} +1 -1
- package/chunks/{otel-OHXIZ666.js → otel-DRJM2PIX.js} +1 -1
- package/chunks/plugin-command-CIDTOPNB.js +2 -0
- package/chunks/provider-command-UZ7KQFAC.js +2 -0
- package/chunks/run-acp-command-AKDLHKMR.js +59 -0
- package/chunks/{run-exec-command-5ADSQR2Z.js → run-exec-command-UXTPS7LC.js} +1 -1
- package/chunks/{skills-command-XXXEZAG6.js → skills-command-57TF53NO.js} +1 -1
- package/chunks/src-5PSNGHHD.js +2 -0
- package/chunks/{src-IBHIRTD7.js → src-YZ26EVSY.js} +1 -1
- package/chunks/telemetry-3NXMCOVD.js +2 -0
- package/chunks/{telemetry-command-COQG2AKK.js → telemetry-command-CMDERYNN.js} +1 -1
- package/chunks/{tools-WDBB2JKV.js → tools-CRJR35HS.js} +1 -1
- package/chunks/{undici-TUGHZJSA.js → undici-O4OQVZ6I.js} +1 -1
- package/chunks/{update-NB6OD572.js → update-ACFAGV6F.js} +1 -1
- package/cli.js +2 -3
- package/embedded/alran-tools/cli.mjs +1 -5
- package/embedded/alran-tools/manifest.json +1 -1
- package/image-preview-worker.js +1 -1
- package/matrix-mcp-stdio.js +1 -1
- package/package.json +1 -1
- package/quickjs-worker.js +1 -1
- package/chunks/azure-openai-responses-OWHMUNKC.js +0 -2
- package/chunks/chunk-C3CMJAAV.js +0 -3
- package/chunks/chunk-ENHOPPS7.js +0 -16
- package/chunks/chunk-FSNYOJPJ.js +0 -2
- package/chunks/chunk-FXOH6TEQ.js +0 -21
- package/chunks/chunk-GRXX6I72.js +0 -2
- package/chunks/chunk-GSYHBK5Q.js +0 -6
- package/chunks/chunk-IWK7PZP7.js +0 -207
- package/chunks/chunk-KCLRJQ53.js +0 -59
- package/chunks/chunk-M7GW4VMR.js +0 -27
- package/chunks/chunk-QFUV5PX6.js +0 -2
- package/chunks/chunk-TW23QKAD.js +0 -3
- package/chunks/chunk-U7U3DJHF.js +0 -2
- package/chunks/chunk-WTAJMYF2.js +0 -249
- package/chunks/chunk-YLQXZBEL.js +0 -2
- package/chunks/chunk-Z6BHCXKT.js +0 -25
- package/chunks/chunk-Z6HBNJCA.js +0 -8
- package/chunks/launcher-FCZ3EDBF.js +0 -61
- package/chunks/lifecycle-GY435YMF.js +0 -2
- package/chunks/openai-codex-responses-FPCDNRL5.js +0 -2
- package/chunks/openai-completions-D32YW6KL.js +0 -2
- package/chunks/openai-responses-ZCGSENM4.js +0 -2
- package/chunks/plugin-command-OSAFHS7C.js +0 -2
- package/chunks/provider-command-SKTCHD4E.js +0 -2
- package/chunks/run-acp-command-SG2BDMFJ.js +0 -2
- package/chunks/src-DNIDEMVV.js +0 -2
- package/chunks/telemetry-J7ZLGF5X.js +0 -2
- /package/chunks/{chunk-EOR6EDNR.js → chunk-2AYWJZ72.js} +0 -0
- /package/chunks/{chunk-YPV2X2RG.js → chunk-4XP5XUIZ.js} +0 -0
- /package/chunks/{chunk-NWB7LFOK.js → chunk-5DQTVSQV.js} +0 -0
- /package/chunks/{chunk-OIQ336YE.js → chunk-EJN3SE5B.js} +0 -0
- /package/chunks/{chunk-A7GMJNA2.js → chunk-K5DTFR6D.js} +0 -0
- /package/chunks/{chunk-ZQOALVGL.js → chunk-R44C5DM6.js} +0 -0
- /package/chunks/{chunk-PNXZWSWT.js → chunk-UJCAE7SG.js} +0 -0
- /package/chunks/{chunk-J3KCPYZT.js → chunk-W5ZOLW7T.js} +0 -0
- /package/chunks/{chunk-XAGZ6ZEU.js → chunk-XLVABFJC.js} +0 -0
- /package/chunks/{chunk-N5SVBCUB.js → chunk-XSEU4WQD.js} +0 -0
- /package/chunks/{chunk-CSOUJVKM.js → chunk-Z5HOCNTZ.js} +0 -0
- /package/chunks/{emscripten-module-ZS3PMSDF.js → emscripten-module-3WGSFZYF.js} +0 -0
- /package/chunks/{emscripten-module-XPTEOIWW.js → emscripten-module-74WUXTHL.js} +0 -0
- /package/chunks/{emscripten-module-WYNDFH3N.js → emscripten-module-MCN4Y3N4.js} +0 -0
- /package/chunks/{emscripten-module-RD6P2XH5.js → emscripten-module-NEAT5LGD.js} +0 -0
- /package/chunks/{ffi-ORLOPBB3.js → ffi-JIGPPPF7.js} +0 -0
- /package/chunks/{ffi-IO7WZQNG.js → ffi-RLX77WFG.js} +0 -0
- /package/chunks/{pdfjs-SHZAF7PF.js → pdfjs-2UOWBGC2.js} +0 -0
- /package/chunks/{photon_rs-C52RL4CI.js → photon_rs-MVWYTYTO.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __alran_cR } from "module"; import { basename as __alran_basename, dirname as __alran_dirname, join as __alran_join } from "path"; import { fileURLToPath as __alran_fileURLToPath, pathToFileURL as __alran_pathToFileURL } from "url"; const __alran_tuiCurrentModuleDir = __alran_dirname(__alran_fileURLToPath(import.meta.url)); const __alran_tuiPackageRoot = __alran_basename(__alran_tuiCurrentModuleDir) === "chunks" ? __alran_dirname(__alran_tuiCurrentModuleDir) : __alran_tuiCurrentModuleDir; const __alran_tuiPackageEntryUrl = __alran_pathToFileURL(__alran_join(__alran_tuiPackageRoot, "cli.js")).href; const require = __alran_cR(__alran_tuiPackageEntryUrl); const __dirname = __alran_tuiPackageRoot;
|
|
2
|
-
import{a as ye}from"./chunk-CSOUJVKM.js";import{a as m,c as O}from"./chunk-XQK7JM66.js";var V=O((ot,Q)=>{var M=1e3;var N=M*60;var q=N*60;var E=q*24;var ge=E*7;var be=E*365.25;Q.exports=function(e,r){r=r||{};var t=typeof e;if(t==="string"&&e.length>0){return me(e)}else if(t==="number"&&isFinite(e)){return r.long?_e(e):ve(e)}throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function me(e){e=String(e);if(e.length>100){return}var r=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!r){return}var t=parseFloat(r[1]);var n=(r[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return t*be;case"weeks":case"week":case"w":return t*ge;case"days":case"day":case"d":return t*E;case"hours":case"hour":case"hrs":case"hr":case"h":return t*q;case"minutes":case"minute":case"mins":case"min":case"m":return t*N;case"seconds":case"second":case"secs":case"sec":case"s":return t*M;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return void 0}}function ve(e){var r=Math.abs(e);if(r>=E){return Math.round(e/E)+"d"}if(r>=q){return Math.round(e/q)+"h"}if(r>=N){return Math.round(e/N)+"m"}if(r>=M){return Math.round(e/M)+"s"}return e+"ms"}function _e(e){var r=Math.abs(e);if(r>=E){return $(e,r,E,"day")}if(r>=q){return $(e,r,q,"hour")}if(r>=N){return $(e,r,N,"minute")}if(r>=M){return $(e,r,M,"second")}return e+" ms"}function $(e,r,t,n){var s=r>=t*1.5;return Math.round(e/t)+" "+n+(s?"s":"")}});var G=O((it,X)=>{function we(e){t.debug=t;t.default=t;t.coerce=S;t.disable=C;t.enable=s;t.enabled=y;t.humanize=V();t.destroy=x;Object.keys(e).forEach(o=>{t[o]=e[o]});t.names=[];t.skips=[];t.formatters={};function r(o){let i=0;for(let c=0;c<o.length;c++){i=(i<<5)-i+o.charCodeAt(c);i|=0}return t.colors[Math.abs(i)%t.colors.length]}t.selectColor=r;function t(o){let i;let c=null;let a;let v;function l(...d){if(!l.enabled){return}const F=l;const _=Number(new Date);const j=_-(i||_);F.diff=j;F.prev=i;F.curr=_;i=_;d[0]=t.coerce(d[0]);if(typeof d[0]!=="string"){d.unshift("%O")}let P=0;d[0]=d[0].replace(/%([a-zA-Z%])/g,(A,I)=>{if(A==="%%"){return"%"}P++;const K=t.formatters[I];if(typeof K==="function"){const Ce=d[P];A=K.call(F,Ce);d.splice(P,1);P--}return A});t.formatArgs.call(F,d);const D=F.log||t.log;D.apply(F,d)}l.namespace=o;l.useColors=t.useColors();l.color=t.selectColor(o);l.extend=n;l.destroy=t.destroy;Object.defineProperty(l,"enabled",{enumerable:true,configurable:false,get:()=>{if(c!==null){return c}if(a!==t.namespaces){a=t.namespaces;v=t.enabled(o)}return v},set:d=>{c=d}});if(typeof t.init==="function"){t.init(l)}return l}function n(o,i){const c=t(this.namespace+(typeof i==="undefined"?":":i)+o);c.log=this.log;return c}function s(o){t.save(o);t.namespaces=o;t.names=[];t.skips=[];const i=(typeof o==="string"?o:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const c of i){if(c[0]==="-"){t.skips.push(c.slice(1))}else{t.names.push(c)}}}function u(o,i){let c=0;let a=0;let v=-1;let l=0;while(c<o.length){if(a<i.length&&(i[a]===o[c]||i[a]==="*")){if(i[a]==="*"){v=a;l=c;a++}else{c++;a++}}else if(v!==-1){a=v+1;l++;c=l}else{return false}}while(a<i.length&&i[a]==="*"){a++}return a===i.length}function C(){const o=[...t.names,...t.skips.map(i=>"-"+i)].join(",");t.enable("");return o}function y(o){for(const i of t.skips){if(u(o,i)){return false}}for(const i of t.names){if(u(o,i)){return true}}return false}function S(o){if(o instanceof Error){return o.stack||o.message}return o}function x(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}t.enable(t.load());return t}X.exports=we});var Y=O((p,L)=>{p.formatArgs=Oe;p.save=Se;p.load=Pe;p.useColors=Fe;p.storage=xe();p.destroy=(()=>{let e=false;return()=>{if(!e){e=true;console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}}})();p.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Fe(){if(typeof window!=="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)){return true}if(typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)){return false}let e;return typeof document!=="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!=="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!=="undefined"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Oe(e){e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+L.exports.humanize(this.diff);if(!this.useColors){return}const r="color: "+this.color;e.splice(1,0,r,"color: inherit");let t=0;let n=0;e[0].replace(/%[a-zA-Z%]/g,s=>{if(s==="%%"){return}t++;if(s==="%c"){n=t}});e.splice(n,0,r)}p.log=console.debug||console.log||(()=>{});function Se(e){try{if(e){p.storage.setItem("debug",e)}else{p.storage.removeItem("debug")}}catch(r){}}function Pe(){let e;try{e=p.storage.getItem("debug")||p.storage.getItem("DEBUG")}catch(r){}if(!e&&typeof process!=="undefined"&&"env"in process){e=process.env.DEBUG}return e}function xe(){try{return localStorage}catch(e){}}L.exports=G()(p);var{formatters:je}=L.exports;je.j=function(e){try{return JSON.stringify(e)}catch(r){return"[UnexpectedJSONParseError]: "+r.message}}});var te=O((f,H)=>{var Ae=m("tty");var T=m("util");f.init=De;f.log=Ne;f.formatArgs=Ie;f.save=qe;f.load=Be;f.useColors=Ee;f.destroy=T.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");f.colors=[6,2,3,4,5,1];try{const e=ye();if(e&&(e.stderr||e).level>=2){f.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}}catch(e){}f.inspectOpts=Object.keys(process.env).filter(e=>{return/^debug_/i.test(e)}).reduce((e,r)=>{const t=r.substring(6).toLowerCase().replace(/_([a-z])/g,(s,u)=>{return u.toUpperCase()});let n=process.env[r];if(/^(yes|on|true|enabled)$/i.test(n)){n=true}else if(/^(no|off|false|disabled)$/i.test(n)){n=false}else if(n==="null"){n=null}else{n=Number(n)}e[t]=n;return e},{});function Ee(){return"colors"in f.inspectOpts?Boolean(f.inspectOpts.colors):Ae.isatty(process.stderr.fd)}function Ie(e){const{namespace:r,useColors:t}=this;if(t){const n=this.color;const s="\x1B[3"+(n<8?n:"8;5;"+n);const u=` ${s};1m${r} \x1B[0m`;e[0]=u+e[0].split("\n").join("\n"+u);e.push(s+"m+"+H.exports.humanize(this.diff)+"\x1B[0m")}else{e[0]=Me()+r+" "+e[0]}}function Me(){if(f.inspectOpts.hideDate){return""}return new Date().toISOString()+" "}function Ne(...e){return process.stderr.write(T.formatWithOptions(f.inspectOpts,...e)+"\n")}function qe(e){if(e){process.env.DEBUG=e}else{delete process.env.DEBUG}}function Be(){return process.env.DEBUG}function De(e){e.inspectOpts={};const r=Object.keys(f.inspectOpts);for(let t=0;t<r.length;t++){e.inspectOpts[r[t]]=f.inspectOpts[r[t]]}}H.exports=G()(f);var{formatters:ee}=H.exports;ee.o=function(e){this.inspectOpts.colors=this.useColors;return T.inspect(e,this.inspectOpts).split("\n").map(r=>r.trim()).join(" ")};ee.O=function(e){this.inspectOpts.colors=this.useColors;return T.inspect(e,this.inspectOpts)}});var W=O((ct,J)=>{if(typeof process==="undefined"||process.type==="renderer"||process.browser===true||process.__nwjs){J.exports=Y()}else{J.exports=te()}});var se=O(h=>{"use strict";var ke=h&&h.__createBinding||(Object.create?(function(e,r,t,n){if(n===void 0)n=t;var s=Object.getOwnPropertyDescriptor(r,t);if(!s||("get"in s?!r.__esModule:s.writable||s.configurable)){s={enumerable:true,get:function(){return r[t]}}}Object.defineProperty(e,n,s)}):(function(e,r,t,n){if(n===void 0)n=t;e[n]=r[t]}));var $e=h&&h.__setModuleDefault||(Object.create?(function(e,r){Object.defineProperty(e,"default",{enumerable:true,value:r})}):function(e,r){e["default"]=r});var re=h&&h.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null){for(var t in e)if(t!=="default"&&Object.prototype.hasOwnProperty.call(e,t))ke(r,e,t)}$e(r,e);return r};Object.defineProperty(h,"__esModule",{value:true});h.req=h.json=h.toBuffer=void 0;var Le=re(m("http"));var Te=re(m("https"));async function ne(e){let r=0;const t=[];for await(const n of e){r+=n.length;t.push(n)}return Buffer.concat(t,r)}h.toBuffer=ne;async function He(e){const r=await ne(e);const t=r.toString("utf8");try{return JSON.parse(t)}catch(n){const s=n;s.message+=` (input: ${t})`;throw s}}h.json=He;function Re(e,r={}){const t=typeof e==="string"?e:e.href;const n=(t.startsWith("https:")?Te:Le).request(e,r);const s=new Promise((u,C)=>{n.once("response",u).once("error",C).end()});n.then=s.then.bind(s);return n}h.req=Re});var ue=O(g=>{"use strict";var ie=g&&g.__createBinding||(Object.create?(function(e,r,t,n){if(n===void 0)n=t;var s=Object.getOwnPropertyDescriptor(r,t);if(!s||("get"in s?!r.__esModule:s.writable||s.configurable)){s={enumerable:true,get:function(){return r[t]}}}Object.defineProperty(e,n,s)}):(function(e,r,t,n){if(n===void 0)n=t;e[n]=r[t]}));var Ue=g&&g.__setModuleDefault||(Object.create?(function(e,r){Object.defineProperty(e,"default",{enumerable:true,value:r})}):function(e,r){e["default"]=r});var ce=g&&g.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null){for(var t in e)if(t!=="default"&&Object.prototype.hasOwnProperty.call(e,t))ie(r,e,t)}Ue(r,e);return r};var ze=g&&g.__exportStar||function(e,r){for(var t in e)if(t!=="default"&&!Object.prototype.hasOwnProperty.call(r,t))ie(r,e,t)};Object.defineProperty(g,"__esModule",{value:true});g.Agent=void 0;var Ge=ce(m("net"));var oe=ce(m("http"));var Je=m("https");ze(se(),g);var w=Symbol("AgentBaseInternalState");var Z=class extends oe.Agent{constructor(r){super(r);this[w]={}}isSecureEndpoint(r){if(r){if(typeof r.secureEndpoint==="boolean"){return r.secureEndpoint}if(typeof r.protocol==="string"){return r.protocol==="https:"}}const{stack:t}=new Error;if(typeof t!=="string")return false;return t.split("\n").some(n=>n.indexOf("(https.js:")!==-1||n.indexOf("node:https:")!==-1)}incrementSockets(r){if(this.maxSockets===Infinity&&this.maxTotalSockets===Infinity){return null}if(!this.sockets[r]){this.sockets[r]=[]}const t=new Ge.Socket({writable:false});this.sockets[r].push(t);this.totalSocketCount++;return t}decrementSockets(r,t){if(!this.sockets[r]||t===null){return}const n=this.sockets[r];const s=n.indexOf(t);if(s!==-1){n.splice(s,1);this.totalSocketCount--;if(n.length===0){delete this.sockets[r]}}}getName(r){const t=this.isSecureEndpoint(r);if(t){return Je.Agent.prototype.getName.call(this,r)}return super.getName(r)}createSocket(r,t,n){const s={...t,secureEndpoint:this.isSecureEndpoint(t)};const u=this.getName(s);const C=this.incrementSockets(u);Promise.resolve().then(()=>this.connect(r,s)).then(y=>{this.decrementSockets(u,C);if(y instanceof oe.Agent){try{return y.addRequest(r,s)}catch(S){return n(S)}}this[w].currentSocket=y;super.createSocket(r,t,n)},y=>{this.decrementSockets(u,C);n(y)})}createConnection(){const r=this[w].currentSocket;this[w].currentSocket=void 0;if(!r){throw new Error("No socket was returned in the `connect()` function")}return r}get defaultPort(){return this[w].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(r){if(this[w]){this[w].defaultPort=r}}get protocol(){return this[w].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(r){if(this[w]){this[w].protocol=r}}};g.Agent=Z});var ae=O(B=>{"use strict";var We=B&&B.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(B,"__esModule",{value:true});B.parseProxyResponse=void 0;var Ze=We(W());var R=(0,Ze.default)("https-proxy-agent:parse-proxy-response");function Ke(e){return new Promise((r,t)=>{let n=0;const s=[];function u(){const o=e.read();if(o)x(o);else e.once("readable",u)}function C(){e.removeListener("end",y);e.removeListener("error",S);e.removeListener("readable",u)}function y(){C();R("onend");t(new Error("Proxy connection ended before receiving CONNECT response"))}function S(o){C();R("onerror %o",o);t(o)}function x(o){s.push(o);n+=o.length;const i=Buffer.concat(s,n);const c=i.indexOf("\r\n\r\n");if(c===-1){R("have not received end of HTTP headers yet...");u();return}const a=i.slice(0,c).toString("ascii").split("\r\n");const v=a.shift();if(!v){e.destroy();return t(new Error("No header received from proxy CONNECT response"))}const l=v.split(" ");const d=+l[1];const F=l.slice(2).join(" ");const _={};for(const j of a){if(!j)continue;const P=j.indexOf(":");if(P===-1){e.destroy();return t(new Error(`Invalid header from proxy CONNECT response: "${j}"`))}const D=j.slice(0,P).toLowerCase();const A=j.slice(P+1).trimStart();const I=_[D];if(typeof I==="string"){_[D]=[I,A]}else if(Array.isArray(I)){I.push(A)}else{_[D]=A}}R("got proxy server response: %o %o",v,_);C();r({connect:{statusCode:d,statusText:F,headers:_},buffered:i})}e.on("error",S);e.on("end",y);u()})}B.parseProxyResponse=Ke});var st=O(b=>{var Qe=b&&b.__createBinding||(Object.create?(function(e,r,t,n){if(n===void 0)n=t;var s=Object.getOwnPropertyDescriptor(r,t);if(!s||("get"in s?!r.__esModule:s.writable||s.configurable)){s={enumerable:true,get:function(){return r[t]}}}Object.defineProperty(e,n,s)}):(function(e,r,t,n){if(n===void 0)n=t;e[n]=r[t]}));var Ve=b&&b.__setModuleDefault||(Object.create?(function(e,r){Object.defineProperty(e,"default",{enumerable:true,value:r})}):function(e,r){e["default"]=r});var pe=b&&b.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null){for(var t in e)if(t!=="default"&&Object.prototype.hasOwnProperty.call(e,t))Qe(r,e,t)}Ve(r,e);return r};var he=b&&b.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(b,"__esModule",{value:true});b.HttpsProxyAgent=void 0;var U=pe(m("net"));var fe=pe(m("tls"));var Xe=he(m("assert"));var Ye=he(W());var et=ue();var tt=m("url");var rt=ae();var k=(0,Ye.default)("https-proxy-agent");var le=e=>{if(e.servername===void 0&&e.host&&!U.isIP(e.host)){return{...e,servername:e.host}}return e};var z=class extends et.Agent{constructor(r,t){super(t);this.options={path:void 0};this.proxy=typeof r==="string"?new tt.URL(r):r;this.proxyHeaders=t?.headers??{};k("Creating new HttpsProxyAgent instance: %o",this.proxy.href);const n=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,"");const s=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...t?de(t,"headers"):null,host:n,port:s}}async connect(r,t){const{proxy:n}=this;if(!t.host){throw new TypeError('No "host" provided')}let s;if(n.protocol==="https:"){k("Creating `tls.Socket`: %o",this.connectOpts);s=fe.connect(le(this.connectOpts))}else{k("Creating `net.Socket`: %o",this.connectOpts);s=U.connect(this.connectOpts)}const u=typeof this.proxyHeaders==="function"?this.proxyHeaders():{...this.proxyHeaders};const C=U.isIPv6(t.host)?`[${t.host}]`:t.host;let y=`CONNECT ${C}:${t.port} HTTP/1.1\r
|
|
2
|
+
import{a as ye}from"./chunk-Z5HOCNTZ.js";import{a as m,c as O}from"./chunk-XQK7JM66.js";var V=O((ot,Q)=>{var M=1e3;var N=M*60;var q=N*60;var E=q*24;var ge=E*7;var be=E*365.25;Q.exports=function(e,r){r=r||{};var t=typeof e;if(t==="string"&&e.length>0){return me(e)}else if(t==="number"&&isFinite(e)){return r.long?_e(e):ve(e)}throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function me(e){e=String(e);if(e.length>100){return}var r=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!r){return}var t=parseFloat(r[1]);var n=(r[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return t*be;case"weeks":case"week":case"w":return t*ge;case"days":case"day":case"d":return t*E;case"hours":case"hour":case"hrs":case"hr":case"h":return t*q;case"minutes":case"minute":case"mins":case"min":case"m":return t*N;case"seconds":case"second":case"secs":case"sec":case"s":return t*M;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return void 0}}function ve(e){var r=Math.abs(e);if(r>=E){return Math.round(e/E)+"d"}if(r>=q){return Math.round(e/q)+"h"}if(r>=N){return Math.round(e/N)+"m"}if(r>=M){return Math.round(e/M)+"s"}return e+"ms"}function _e(e){var r=Math.abs(e);if(r>=E){return $(e,r,E,"day")}if(r>=q){return $(e,r,q,"hour")}if(r>=N){return $(e,r,N,"minute")}if(r>=M){return $(e,r,M,"second")}return e+" ms"}function $(e,r,t,n){var s=r>=t*1.5;return Math.round(e/t)+" "+n+(s?"s":"")}});var G=O((it,X)=>{function we(e){t.debug=t;t.default=t;t.coerce=S;t.disable=C;t.enable=s;t.enabled=y;t.humanize=V();t.destroy=x;Object.keys(e).forEach(o=>{t[o]=e[o]});t.names=[];t.skips=[];t.formatters={};function r(o){let i=0;for(let c=0;c<o.length;c++){i=(i<<5)-i+o.charCodeAt(c);i|=0}return t.colors[Math.abs(i)%t.colors.length]}t.selectColor=r;function t(o){let i;let c=null;let a;let v;function l(...d){if(!l.enabled){return}const F=l;const _=Number(new Date);const j=_-(i||_);F.diff=j;F.prev=i;F.curr=_;i=_;d[0]=t.coerce(d[0]);if(typeof d[0]!=="string"){d.unshift("%O")}let P=0;d[0]=d[0].replace(/%([a-zA-Z%])/g,(A,I)=>{if(A==="%%"){return"%"}P++;const K=t.formatters[I];if(typeof K==="function"){const Ce=d[P];A=K.call(F,Ce);d.splice(P,1);P--}return A});t.formatArgs.call(F,d);const D=F.log||t.log;D.apply(F,d)}l.namespace=o;l.useColors=t.useColors();l.color=t.selectColor(o);l.extend=n;l.destroy=t.destroy;Object.defineProperty(l,"enabled",{enumerable:true,configurable:false,get:()=>{if(c!==null){return c}if(a!==t.namespaces){a=t.namespaces;v=t.enabled(o)}return v},set:d=>{c=d}});if(typeof t.init==="function"){t.init(l)}return l}function n(o,i){const c=t(this.namespace+(typeof i==="undefined"?":":i)+o);c.log=this.log;return c}function s(o){t.save(o);t.namespaces=o;t.names=[];t.skips=[];const i=(typeof o==="string"?o:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const c of i){if(c[0]==="-"){t.skips.push(c.slice(1))}else{t.names.push(c)}}}function u(o,i){let c=0;let a=0;let v=-1;let l=0;while(c<o.length){if(a<i.length&&(i[a]===o[c]||i[a]==="*")){if(i[a]==="*"){v=a;l=c;a++}else{c++;a++}}else if(v!==-1){a=v+1;l++;c=l}else{return false}}while(a<i.length&&i[a]==="*"){a++}return a===i.length}function C(){const o=[...t.names,...t.skips.map(i=>"-"+i)].join(",");t.enable("");return o}function y(o){for(const i of t.skips){if(u(o,i)){return false}}for(const i of t.names){if(u(o,i)){return true}}return false}function S(o){if(o instanceof Error){return o.stack||o.message}return o}function x(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}t.enable(t.load());return t}X.exports=we});var Y=O((p,L)=>{p.formatArgs=Oe;p.save=Se;p.load=Pe;p.useColors=Fe;p.storage=xe();p.destroy=(()=>{let e=false;return()=>{if(!e){e=true;console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}}})();p.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Fe(){if(typeof window!=="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)){return true}if(typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)){return false}let e;return typeof document!=="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!=="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!=="undefined"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Oe(e){e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+L.exports.humanize(this.diff);if(!this.useColors){return}const r="color: "+this.color;e.splice(1,0,r,"color: inherit");let t=0;let n=0;e[0].replace(/%[a-zA-Z%]/g,s=>{if(s==="%%"){return}t++;if(s==="%c"){n=t}});e.splice(n,0,r)}p.log=console.debug||console.log||(()=>{});function Se(e){try{if(e){p.storage.setItem("debug",e)}else{p.storage.removeItem("debug")}}catch(r){}}function Pe(){let e;try{e=p.storage.getItem("debug")||p.storage.getItem("DEBUG")}catch(r){}if(!e&&typeof process!=="undefined"&&"env"in process){e=process.env.DEBUG}return e}function xe(){try{return localStorage}catch(e){}}L.exports=G()(p);var{formatters:je}=L.exports;je.j=function(e){try{return JSON.stringify(e)}catch(r){return"[UnexpectedJSONParseError]: "+r.message}}});var te=O((f,H)=>{var Ae=m("tty");var T=m("util");f.init=De;f.log=Ne;f.formatArgs=Ie;f.save=qe;f.load=Be;f.useColors=Ee;f.destroy=T.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");f.colors=[6,2,3,4,5,1];try{const e=ye();if(e&&(e.stderr||e).level>=2){f.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}}catch(e){}f.inspectOpts=Object.keys(process.env).filter(e=>{return/^debug_/i.test(e)}).reduce((e,r)=>{const t=r.substring(6).toLowerCase().replace(/_([a-z])/g,(s,u)=>{return u.toUpperCase()});let n=process.env[r];if(/^(yes|on|true|enabled)$/i.test(n)){n=true}else if(/^(no|off|false|disabled)$/i.test(n)){n=false}else if(n==="null"){n=null}else{n=Number(n)}e[t]=n;return e},{});function Ee(){return"colors"in f.inspectOpts?Boolean(f.inspectOpts.colors):Ae.isatty(process.stderr.fd)}function Ie(e){const{namespace:r,useColors:t}=this;if(t){const n=this.color;const s="\x1B[3"+(n<8?n:"8;5;"+n);const u=` ${s};1m${r} \x1B[0m`;e[0]=u+e[0].split("\n").join("\n"+u);e.push(s+"m+"+H.exports.humanize(this.diff)+"\x1B[0m")}else{e[0]=Me()+r+" "+e[0]}}function Me(){if(f.inspectOpts.hideDate){return""}return new Date().toISOString()+" "}function Ne(...e){return process.stderr.write(T.formatWithOptions(f.inspectOpts,...e)+"\n")}function qe(e){if(e){process.env.DEBUG=e}else{delete process.env.DEBUG}}function Be(){return process.env.DEBUG}function De(e){e.inspectOpts={};const r=Object.keys(f.inspectOpts);for(let t=0;t<r.length;t++){e.inspectOpts[r[t]]=f.inspectOpts[r[t]]}}H.exports=G()(f);var{formatters:ee}=H.exports;ee.o=function(e){this.inspectOpts.colors=this.useColors;return T.inspect(e,this.inspectOpts).split("\n").map(r=>r.trim()).join(" ")};ee.O=function(e){this.inspectOpts.colors=this.useColors;return T.inspect(e,this.inspectOpts)}});var W=O((ct,J)=>{if(typeof process==="undefined"||process.type==="renderer"||process.browser===true||process.__nwjs){J.exports=Y()}else{J.exports=te()}});var se=O(h=>{"use strict";var ke=h&&h.__createBinding||(Object.create?(function(e,r,t,n){if(n===void 0)n=t;var s=Object.getOwnPropertyDescriptor(r,t);if(!s||("get"in s?!r.__esModule:s.writable||s.configurable)){s={enumerable:true,get:function(){return r[t]}}}Object.defineProperty(e,n,s)}):(function(e,r,t,n){if(n===void 0)n=t;e[n]=r[t]}));var $e=h&&h.__setModuleDefault||(Object.create?(function(e,r){Object.defineProperty(e,"default",{enumerable:true,value:r})}):function(e,r){e["default"]=r});var re=h&&h.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null){for(var t in e)if(t!=="default"&&Object.prototype.hasOwnProperty.call(e,t))ke(r,e,t)}$e(r,e);return r};Object.defineProperty(h,"__esModule",{value:true});h.req=h.json=h.toBuffer=void 0;var Le=re(m("http"));var Te=re(m("https"));async function ne(e){let r=0;const t=[];for await(const n of e){r+=n.length;t.push(n)}return Buffer.concat(t,r)}h.toBuffer=ne;async function He(e){const r=await ne(e);const t=r.toString("utf8");try{return JSON.parse(t)}catch(n){const s=n;s.message+=` (input: ${t})`;throw s}}h.json=He;function Re(e,r={}){const t=typeof e==="string"?e:e.href;const n=(t.startsWith("https:")?Te:Le).request(e,r);const s=new Promise((u,C)=>{n.once("response",u).once("error",C).end()});n.then=s.then.bind(s);return n}h.req=Re});var ue=O(g=>{"use strict";var ie=g&&g.__createBinding||(Object.create?(function(e,r,t,n){if(n===void 0)n=t;var s=Object.getOwnPropertyDescriptor(r,t);if(!s||("get"in s?!r.__esModule:s.writable||s.configurable)){s={enumerable:true,get:function(){return r[t]}}}Object.defineProperty(e,n,s)}):(function(e,r,t,n){if(n===void 0)n=t;e[n]=r[t]}));var Ue=g&&g.__setModuleDefault||(Object.create?(function(e,r){Object.defineProperty(e,"default",{enumerable:true,value:r})}):function(e,r){e["default"]=r});var ce=g&&g.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null){for(var t in e)if(t!=="default"&&Object.prototype.hasOwnProperty.call(e,t))ie(r,e,t)}Ue(r,e);return r};var ze=g&&g.__exportStar||function(e,r){for(var t in e)if(t!=="default"&&!Object.prototype.hasOwnProperty.call(r,t))ie(r,e,t)};Object.defineProperty(g,"__esModule",{value:true});g.Agent=void 0;var Ge=ce(m("net"));var oe=ce(m("http"));var Je=m("https");ze(se(),g);var w=Symbol("AgentBaseInternalState");var Z=class extends oe.Agent{constructor(r){super(r);this[w]={}}isSecureEndpoint(r){if(r){if(typeof r.secureEndpoint==="boolean"){return r.secureEndpoint}if(typeof r.protocol==="string"){return r.protocol==="https:"}}const{stack:t}=new Error;if(typeof t!=="string")return false;return t.split("\n").some(n=>n.indexOf("(https.js:")!==-1||n.indexOf("node:https:")!==-1)}incrementSockets(r){if(this.maxSockets===Infinity&&this.maxTotalSockets===Infinity){return null}if(!this.sockets[r]){this.sockets[r]=[]}const t=new Ge.Socket({writable:false});this.sockets[r].push(t);this.totalSocketCount++;return t}decrementSockets(r,t){if(!this.sockets[r]||t===null){return}const n=this.sockets[r];const s=n.indexOf(t);if(s!==-1){n.splice(s,1);this.totalSocketCount--;if(n.length===0){delete this.sockets[r]}}}getName(r){const t=this.isSecureEndpoint(r);if(t){return Je.Agent.prototype.getName.call(this,r)}return super.getName(r)}createSocket(r,t,n){const s={...t,secureEndpoint:this.isSecureEndpoint(t)};const u=this.getName(s);const C=this.incrementSockets(u);Promise.resolve().then(()=>this.connect(r,s)).then(y=>{this.decrementSockets(u,C);if(y instanceof oe.Agent){try{return y.addRequest(r,s)}catch(S){return n(S)}}this[w].currentSocket=y;super.createSocket(r,t,n)},y=>{this.decrementSockets(u,C);n(y)})}createConnection(){const r=this[w].currentSocket;this[w].currentSocket=void 0;if(!r){throw new Error("No socket was returned in the `connect()` function")}return r}get defaultPort(){return this[w].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(r){if(this[w]){this[w].defaultPort=r}}get protocol(){return this[w].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(r){if(this[w]){this[w].protocol=r}}};g.Agent=Z});var ae=O(B=>{"use strict";var We=B&&B.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(B,"__esModule",{value:true});B.parseProxyResponse=void 0;var Ze=We(W());var R=(0,Ze.default)("https-proxy-agent:parse-proxy-response");function Ke(e){return new Promise((r,t)=>{let n=0;const s=[];function u(){const o=e.read();if(o)x(o);else e.once("readable",u)}function C(){e.removeListener("end",y);e.removeListener("error",S);e.removeListener("readable",u)}function y(){C();R("onend");t(new Error("Proxy connection ended before receiving CONNECT response"))}function S(o){C();R("onerror %o",o);t(o)}function x(o){s.push(o);n+=o.length;const i=Buffer.concat(s,n);const c=i.indexOf("\r\n\r\n");if(c===-1){R("have not received end of HTTP headers yet...");u();return}const a=i.slice(0,c).toString("ascii").split("\r\n");const v=a.shift();if(!v){e.destroy();return t(new Error("No header received from proxy CONNECT response"))}const l=v.split(" ");const d=+l[1];const F=l.slice(2).join(" ");const _={};for(const j of a){if(!j)continue;const P=j.indexOf(":");if(P===-1){e.destroy();return t(new Error(`Invalid header from proxy CONNECT response: "${j}"`))}const D=j.slice(0,P).toLowerCase();const A=j.slice(P+1).trimStart();const I=_[D];if(typeof I==="string"){_[D]=[I,A]}else if(Array.isArray(I)){I.push(A)}else{_[D]=A}}R("got proxy server response: %o %o",v,_);C();r({connect:{statusCode:d,statusText:F,headers:_},buffered:i})}e.on("error",S);e.on("end",y);u()})}B.parseProxyResponse=Ke});var st=O(b=>{var Qe=b&&b.__createBinding||(Object.create?(function(e,r,t,n){if(n===void 0)n=t;var s=Object.getOwnPropertyDescriptor(r,t);if(!s||("get"in s?!r.__esModule:s.writable||s.configurable)){s={enumerable:true,get:function(){return r[t]}}}Object.defineProperty(e,n,s)}):(function(e,r,t,n){if(n===void 0)n=t;e[n]=r[t]}));var Ve=b&&b.__setModuleDefault||(Object.create?(function(e,r){Object.defineProperty(e,"default",{enumerable:true,value:r})}):function(e,r){e["default"]=r});var pe=b&&b.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null){for(var t in e)if(t!=="default"&&Object.prototype.hasOwnProperty.call(e,t))Qe(r,e,t)}Ve(r,e);return r};var he=b&&b.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(b,"__esModule",{value:true});b.HttpsProxyAgent=void 0;var U=pe(m("net"));var fe=pe(m("tls"));var Xe=he(m("assert"));var Ye=he(W());var et=ue();var tt=m("url");var rt=ae();var k=(0,Ye.default)("https-proxy-agent");var le=e=>{if(e.servername===void 0&&e.host&&!U.isIP(e.host)){return{...e,servername:e.host}}return e};var z=class extends et.Agent{constructor(r,t){super(t);this.options={path:void 0};this.proxy=typeof r==="string"?new tt.URL(r):r;this.proxyHeaders=t?.headers??{};k("Creating new HttpsProxyAgent instance: %o",this.proxy.href);const n=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,"");const s=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...t?de(t,"headers"):null,host:n,port:s}}async connect(r,t){const{proxy:n}=this;if(!t.host){throw new TypeError('No "host" provided')}let s;if(n.protocol==="https:"){k("Creating `tls.Socket`: %o",this.connectOpts);s=fe.connect(le(this.connectOpts))}else{k("Creating `net.Socket`: %o",this.connectOpts);s=U.connect(this.connectOpts)}const u=typeof this.proxyHeaders==="function"?this.proxyHeaders():{...this.proxyHeaders};const C=U.isIPv6(t.host)?`[${t.host}]`:t.host;let y=`CONNECT ${C}:${t.port} HTTP/1.1\r
|
|
3
3
|
`;if(n.username||n.password){const c=`${decodeURIComponent(n.username)}:${decodeURIComponent(n.password)}`;u["Proxy-Authorization"]=`Basic ${Buffer.from(c).toString("base64")}`}u.Host=`${C}:${t.port}`;if(!u["Proxy-Connection"]){u["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close"}for(const c of Object.keys(u)){y+=`${c}: ${u[c]}\r
|
|
4
4
|
`}const S=(0,rt.parseProxyResponse)(s);s.write(`${y}\r
|
|
5
5
|
`);const{connect:x,buffered:o}=await S;r.emit("proxyConnect",x);this.emit("proxyConnect",x,r);if(x.statusCode===200){r.once("socket",nt);if(t.secureEndpoint){k("Upgrading socket connection to TLS");return fe.connect({...de(le(t),"host","path","port"),socket:s})}return s}s.destroy();const i=new U.Socket({writable:false});i.readable=true;r.once("socket",c=>{k("Replaying proxy buffer for failed request");(0,Xe.default)(c.listenerCount("data")>0);c.push(o);c.push(null)});return i}};z.protocols=["http","https"];b.HttpsProxyAgent=z;function nt(e){e.resume()}function de(e,...r){const t={};let n;for(n in e){if(!r.includes(n)){t[n]=e[n]}}return t}});export default st();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __alran_cR } from "module"; import { basename as __alran_basename, dirname as __alran_dirname, join as __alran_join } from "path"; import { fileURLToPath as __alran_fileURLToPath, pathToFileURL as __alran_pathToFileURL } from "url"; const __alran_tuiCurrentModuleDir = __alran_dirname(__alran_fileURLToPath(import.meta.url)); const __alran_tuiPackageRoot = __alran_basename(__alran_tuiCurrentModuleDir) === "chunks" ? __alran_dirname(__alran_tuiCurrentModuleDir) : __alran_tuiCurrentModuleDir; const __alran_tuiPackageEntryUrl = __alran_pathToFileURL(__alran_join(__alran_tuiPackageRoot, "cli.js")).href; const require = __alran_cR(__alran_tuiPackageEntryUrl); const __dirname = __alran_tuiPackageRoot;
|
|
2
|
-
import{a as e}from"./chunk-
|
|
2
|
+
import{a as e}from"./chunk-4XP5XUIZ.js";import"./chunk-XQK7JM66.js";var n=class{constructor(r){this.module=r;this.DEBUG=false;this.QTS_Throw=this.module.cwrap("QTS_Throw","number",["number","number"]);this.QTS_NewError=this.module.cwrap("QTS_NewError","number",["number"]);this.QTS_RuntimeSetMemoryLimit=this.module.cwrap("QTS_RuntimeSetMemoryLimit",null,["number","number"]);this.QTS_RuntimeComputeMemoryUsage=this.module.cwrap("QTS_RuntimeComputeMemoryUsage","number",["number","number"]);this.QTS_RuntimeDumpMemoryUsage=this.module.cwrap("QTS_RuntimeDumpMemoryUsage","number",["number"]);this.QTS_RecoverableLeakCheck=this.module.cwrap("QTS_RecoverableLeakCheck","number",[]);this.QTS_BuildIsSanitizeLeak=this.module.cwrap("QTS_BuildIsSanitizeLeak","number",[]);this.QTS_RuntimeSetMaxStackSize=this.module.cwrap("QTS_RuntimeSetMaxStackSize",null,["number","number"]);this.QTS_GetUndefined=this.module.cwrap("QTS_GetUndefined","number",[]);this.QTS_GetNull=this.module.cwrap("QTS_GetNull","number",[]);this.QTS_GetFalse=this.module.cwrap("QTS_GetFalse","number",[]);this.QTS_GetTrue=this.module.cwrap("QTS_GetTrue","number",[]);this.QTS_NewRuntime=this.module.cwrap("QTS_NewRuntime","number",[]);this.QTS_FreeRuntime=this.module.cwrap("QTS_FreeRuntime",null,["number"]);this.QTS_NewContext=this.module.cwrap("QTS_NewContext","number",["number","number"]);this.QTS_FreeContext=this.module.cwrap("QTS_FreeContext",null,["number"]);this.QTS_FreeValuePointer=this.module.cwrap("QTS_FreeValuePointer",null,["number","number"]);this.QTS_FreeValuePointerRuntime=this.module.cwrap("QTS_FreeValuePointerRuntime",null,["number","number"]);this.QTS_FreeVoidPointer=this.module.cwrap("QTS_FreeVoidPointer",null,["number","number"]);this.QTS_FreeCString=this.module.cwrap("QTS_FreeCString",null,["number","number"]);this.QTS_DupValuePointer=this.module.cwrap("QTS_DupValuePointer","number",["number","number"]);this.QTS_NewObject=this.module.cwrap("QTS_NewObject","number",["number"]);this.QTS_NewObjectProto=this.module.cwrap("QTS_NewObjectProto","number",["number","number"]);this.QTS_NewArray=this.module.cwrap("QTS_NewArray","number",["number"]);this.QTS_NewArrayBuffer=this.module.cwrap("QTS_NewArrayBuffer","number",["number","number","number"]);this.QTS_NewFloat64=this.module.cwrap("QTS_NewFloat64","number",["number","number"]);this.QTS_GetFloat64=this.module.cwrap("QTS_GetFloat64","number",["number","number"]);this.QTS_NewString=this.module.cwrap("QTS_NewString","number",["number","number"]);this.QTS_GetString=this.module.cwrap("QTS_GetString","number",["number","number"]);this.QTS_GetArrayBuffer=this.module.cwrap("QTS_GetArrayBuffer","number",["number","number"]);this.QTS_GetArrayBufferLength=this.module.cwrap("QTS_GetArrayBufferLength","number",["number","number"]);this.QTS_NewSymbol=this.module.cwrap("QTS_NewSymbol","number",["number","number","number"]);this.QTS_GetSymbolDescriptionOrKey=e(this.module.cwrap("QTS_GetSymbolDescriptionOrKey","number",["number","number"]));this.QTS_GetSymbolDescriptionOrKey_MaybeAsync=this.module.cwrap("QTS_GetSymbolDescriptionOrKey","number",["number","number"]);this.QTS_IsGlobalSymbol=this.module.cwrap("QTS_IsGlobalSymbol","number",["number","number"]);this.QTS_IsJobPending=this.module.cwrap("QTS_IsJobPending","number",["number"]);this.QTS_ExecutePendingJob=e(this.module.cwrap("QTS_ExecutePendingJob","number",["number","number","number"]));this.QTS_ExecutePendingJob_MaybeAsync=this.module.cwrap("QTS_ExecutePendingJob","number",["number","number","number"]);this.QTS_GetProp=e(this.module.cwrap("QTS_GetProp","number",["number","number","number"]));this.QTS_GetProp_MaybeAsync=this.module.cwrap("QTS_GetProp","number",["number","number","number"]);this.QTS_GetPropNumber=e(this.module.cwrap("QTS_GetPropNumber","number",["number","number","number"]));this.QTS_GetPropNumber_MaybeAsync=this.module.cwrap("QTS_GetPropNumber","number",["number","number","number"]);this.QTS_SetProp=e(this.module.cwrap("QTS_SetProp",null,["number","number","number","number"]));this.QTS_SetProp_MaybeAsync=this.module.cwrap("QTS_SetProp",null,["number","number","number","number"]);this.QTS_DefineProp=this.module.cwrap("QTS_DefineProp",null,["number","number","number","number","number","number","boolean","boolean","boolean"]);this.QTS_GetOwnPropertyNames=e(this.module.cwrap("QTS_GetOwnPropertyNames","number",["number","number","number","number","number"]));this.QTS_GetOwnPropertyNames_MaybeAsync=this.module.cwrap("QTS_GetOwnPropertyNames","number",["number","number","number","number","number"]);this.QTS_Call=e(this.module.cwrap("QTS_Call","number",["number","number","number","number","number"]));this.QTS_Call_MaybeAsync=this.module.cwrap("QTS_Call","number",["number","number","number","number","number"]);this.QTS_ResolveException=this.module.cwrap("QTS_ResolveException","number",["number","number"]);this.QTS_Dump=e(this.module.cwrap("QTS_Dump","number",["number","number"]));this.QTS_Dump_MaybeAsync=this.module.cwrap("QTS_Dump","number",["number","number"]);this.QTS_Eval=e(this.module.cwrap("QTS_Eval","number",["number","number","number","string","number","number"]));this.QTS_Eval_MaybeAsync=this.module.cwrap("QTS_Eval","number",["number","number","number","string","number","number"]);this.QTS_GetModuleNamespace=this.module.cwrap("QTS_GetModuleNamespace","number",["number","number"]);this.QTS_Typeof=this.module.cwrap("QTS_Typeof","number",["number","number"]);this.QTS_GetLength=this.module.cwrap("QTS_GetLength","number",["number","number","number"]);this.QTS_IsEqual=this.module.cwrap("QTS_IsEqual","number",["number","number","number","number"]);this.QTS_GetGlobalObject=this.module.cwrap("QTS_GetGlobalObject","number",["number"]);this.QTS_NewPromiseCapability=this.module.cwrap("QTS_NewPromiseCapability","number",["number","number"]);this.QTS_PromiseState=this.module.cwrap("QTS_PromiseState","number",["number","number"]);this.QTS_PromiseResult=this.module.cwrap("QTS_PromiseResult","number",["number","number"]);this.QTS_TestStringArg=this.module.cwrap("QTS_TestStringArg",null,["string"]);this.QTS_GetDebugLogEnabled=this.module.cwrap("QTS_GetDebugLogEnabled","number",["number"]);this.QTS_SetDebugLogEnabled=this.module.cwrap("QTS_SetDebugLogEnabled",null,["number","number"]);this.QTS_BuildIsDebug=this.module.cwrap("QTS_BuildIsDebug","number",[]);this.QTS_BuildIsAsyncify=this.module.cwrap("QTS_BuildIsAsyncify","number",[]);this.QTS_NewFunction=this.module.cwrap("QTS_NewFunction","number",["number","number","string"]);this.QTS_ArgvGetJSValueConstPointer=this.module.cwrap("QTS_ArgvGetJSValueConstPointer","number",["number","number"]);this.QTS_RuntimeEnableInterruptHandler=this.module.cwrap("QTS_RuntimeEnableInterruptHandler",null,["number"]);this.QTS_RuntimeDisableInterruptHandler=this.module.cwrap("QTS_RuntimeDisableInterruptHandler",null,["number"]);this.QTS_RuntimeEnableModuleLoader=this.module.cwrap("QTS_RuntimeEnableModuleLoader",null,["number","number"]);this.QTS_RuntimeDisableModuleLoader=this.module.cwrap("QTS_RuntimeDisableModuleLoader",null,["number"]);this.QTS_bjson_encode=this.module.cwrap("QTS_bjson_encode","number",["number","number"]);this.QTS_bjson_decode=this.module.cwrap("QTS_bjson_decode","number",["number","number"])}};export{n as QuickJSAsyncFFI};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __alran_cR } from "module"; import { basename as __alran_basename, dirname as __alran_dirname, join as __alran_join } from "path"; import { fileURLToPath as __alran_fileURLToPath, pathToFileURL as __alran_pathToFileURL } from "url"; const __alran_tuiCurrentModuleDir = __alran_dirname(__alran_fileURLToPath(import.meta.url)); const __alran_tuiPackageRoot = __alran_basename(__alran_tuiCurrentModuleDir) === "chunks" ? __alran_dirname(__alran_tuiCurrentModuleDir) : __alran_tuiCurrentModuleDir; const __alran_tuiPackageEntryUrl = __alran_pathToFileURL(__alran_join(__alran_tuiPackageRoot, "cli.js")).href; const require = __alran_cR(__alran_tuiPackageEntryUrl); const __dirname = __alran_tuiPackageRoot;
|
|
2
|
-
import{a as e}from"./chunk-
|
|
2
|
+
import{a as e}from"./chunk-4XP5XUIZ.js";import"./chunk-XQK7JM66.js";var n=class{constructor(r){this.module=r;this.DEBUG=true;this.QTS_Throw=this.module.cwrap("QTS_Throw","number",["number","number"]);this.QTS_NewError=this.module.cwrap("QTS_NewError","number",["number"]);this.QTS_RuntimeSetMemoryLimit=this.module.cwrap("QTS_RuntimeSetMemoryLimit",null,["number","number"]);this.QTS_RuntimeComputeMemoryUsage=this.module.cwrap("QTS_RuntimeComputeMemoryUsage","number",["number","number"]);this.QTS_RuntimeDumpMemoryUsage=this.module.cwrap("QTS_RuntimeDumpMemoryUsage","number",["number"]);this.QTS_RecoverableLeakCheck=this.module.cwrap("QTS_RecoverableLeakCheck","number",[]);this.QTS_BuildIsSanitizeLeak=this.module.cwrap("QTS_BuildIsSanitizeLeak","number",[]);this.QTS_RuntimeSetMaxStackSize=this.module.cwrap("QTS_RuntimeSetMaxStackSize",null,["number","number"]);this.QTS_GetUndefined=this.module.cwrap("QTS_GetUndefined","number",[]);this.QTS_GetNull=this.module.cwrap("QTS_GetNull","number",[]);this.QTS_GetFalse=this.module.cwrap("QTS_GetFalse","number",[]);this.QTS_GetTrue=this.module.cwrap("QTS_GetTrue","number",[]);this.QTS_NewRuntime=this.module.cwrap("QTS_NewRuntime","number",[]);this.QTS_FreeRuntime=this.module.cwrap("QTS_FreeRuntime",null,["number"]);this.QTS_NewContext=this.module.cwrap("QTS_NewContext","number",["number","number"]);this.QTS_FreeContext=this.module.cwrap("QTS_FreeContext",null,["number"]);this.QTS_FreeValuePointer=this.module.cwrap("QTS_FreeValuePointer",null,["number","number"]);this.QTS_FreeValuePointerRuntime=this.module.cwrap("QTS_FreeValuePointerRuntime",null,["number","number"]);this.QTS_FreeVoidPointer=this.module.cwrap("QTS_FreeVoidPointer",null,["number","number"]);this.QTS_FreeCString=this.module.cwrap("QTS_FreeCString",null,["number","number"]);this.QTS_DupValuePointer=this.module.cwrap("QTS_DupValuePointer","number",["number","number"]);this.QTS_NewObject=this.module.cwrap("QTS_NewObject","number",["number"]);this.QTS_NewObjectProto=this.module.cwrap("QTS_NewObjectProto","number",["number","number"]);this.QTS_NewArray=this.module.cwrap("QTS_NewArray","number",["number"]);this.QTS_NewArrayBuffer=this.module.cwrap("QTS_NewArrayBuffer","number",["number","number","number"]);this.QTS_NewFloat64=this.module.cwrap("QTS_NewFloat64","number",["number","number"]);this.QTS_GetFloat64=this.module.cwrap("QTS_GetFloat64","number",["number","number"]);this.QTS_NewString=this.module.cwrap("QTS_NewString","number",["number","number"]);this.QTS_GetString=this.module.cwrap("QTS_GetString","number",["number","number"]);this.QTS_GetArrayBuffer=this.module.cwrap("QTS_GetArrayBuffer","number",["number","number"]);this.QTS_GetArrayBufferLength=this.module.cwrap("QTS_GetArrayBufferLength","number",["number","number"]);this.QTS_NewSymbol=this.module.cwrap("QTS_NewSymbol","number",["number","number","number"]);this.QTS_GetSymbolDescriptionOrKey=e(this.module.cwrap("QTS_GetSymbolDescriptionOrKey","number",["number","number"]));this.QTS_GetSymbolDescriptionOrKey_MaybeAsync=this.module.cwrap("QTS_GetSymbolDescriptionOrKey","number",["number","number"],{async:true});this.QTS_IsGlobalSymbol=this.module.cwrap("QTS_IsGlobalSymbol","number",["number","number"]);this.QTS_IsJobPending=this.module.cwrap("QTS_IsJobPending","number",["number"]);this.QTS_ExecutePendingJob=e(this.module.cwrap("QTS_ExecutePendingJob","number",["number","number","number"]));this.QTS_ExecutePendingJob_MaybeAsync=this.module.cwrap("QTS_ExecutePendingJob","number",["number","number","number"],{async:true});this.QTS_GetProp=e(this.module.cwrap("QTS_GetProp","number",["number","number","number"]));this.QTS_GetProp_MaybeAsync=this.module.cwrap("QTS_GetProp","number",["number","number","number"],{async:true});this.QTS_GetPropNumber=e(this.module.cwrap("QTS_GetPropNumber","number",["number","number","number"]));this.QTS_GetPropNumber_MaybeAsync=this.module.cwrap("QTS_GetPropNumber","number",["number","number","number"],{async:true});this.QTS_SetProp=e(this.module.cwrap("QTS_SetProp",null,["number","number","number","number"]));this.QTS_SetProp_MaybeAsync=this.module.cwrap("QTS_SetProp",null,["number","number","number","number"],{async:true});this.QTS_DefineProp=this.module.cwrap("QTS_DefineProp",null,["number","number","number","number","number","number","boolean","boolean","boolean"]);this.QTS_GetOwnPropertyNames=e(this.module.cwrap("QTS_GetOwnPropertyNames","number",["number","number","number","number","number"]));this.QTS_GetOwnPropertyNames_MaybeAsync=this.module.cwrap("QTS_GetOwnPropertyNames","number",["number","number","number","number","number"],{async:true});this.QTS_Call=e(this.module.cwrap("QTS_Call","number",["number","number","number","number","number"]));this.QTS_Call_MaybeAsync=this.module.cwrap("QTS_Call","number",["number","number","number","number","number"],{async:true});this.QTS_ResolveException=this.module.cwrap("QTS_ResolveException","number",["number","number"]);this.QTS_Dump=e(this.module.cwrap("QTS_Dump","number",["number","number"]));this.QTS_Dump_MaybeAsync=this.module.cwrap("QTS_Dump","number",["number","number"],{async:true});this.QTS_Eval=e(this.module.cwrap("QTS_Eval","number",["number","number","number","string","number","number"]));this.QTS_Eval_MaybeAsync=this.module.cwrap("QTS_Eval","number",["number","number","number","string","number","number"],{async:true});this.QTS_GetModuleNamespace=this.module.cwrap("QTS_GetModuleNamespace","number",["number","number"]);this.QTS_Typeof=this.module.cwrap("QTS_Typeof","number",["number","number"]);this.QTS_GetLength=this.module.cwrap("QTS_GetLength","number",["number","number","number"]);this.QTS_IsEqual=this.module.cwrap("QTS_IsEqual","number",["number","number","number","number"]);this.QTS_GetGlobalObject=this.module.cwrap("QTS_GetGlobalObject","number",["number"]);this.QTS_NewPromiseCapability=this.module.cwrap("QTS_NewPromiseCapability","number",["number","number"]);this.QTS_PromiseState=this.module.cwrap("QTS_PromiseState","number",["number","number"]);this.QTS_PromiseResult=this.module.cwrap("QTS_PromiseResult","number",["number","number"]);this.QTS_TestStringArg=this.module.cwrap("QTS_TestStringArg",null,["string"]);this.QTS_GetDebugLogEnabled=this.module.cwrap("QTS_GetDebugLogEnabled","number",["number"]);this.QTS_SetDebugLogEnabled=this.module.cwrap("QTS_SetDebugLogEnabled",null,["number","number"]);this.QTS_BuildIsDebug=this.module.cwrap("QTS_BuildIsDebug","number",[]);this.QTS_BuildIsAsyncify=this.module.cwrap("QTS_BuildIsAsyncify","number",[]);this.QTS_NewFunction=this.module.cwrap("QTS_NewFunction","number",["number","number","string"]);this.QTS_ArgvGetJSValueConstPointer=this.module.cwrap("QTS_ArgvGetJSValueConstPointer","number",["number","number"]);this.QTS_RuntimeEnableInterruptHandler=this.module.cwrap("QTS_RuntimeEnableInterruptHandler",null,["number"]);this.QTS_RuntimeDisableInterruptHandler=this.module.cwrap("QTS_RuntimeDisableInterruptHandler",null,["number"]);this.QTS_RuntimeEnableModuleLoader=this.module.cwrap("QTS_RuntimeEnableModuleLoader",null,["number","number"]);this.QTS_RuntimeDisableModuleLoader=this.module.cwrap("QTS_RuntimeDisableModuleLoader",null,["number"]);this.QTS_bjson_encode=this.module.cwrap("QTS_bjson_encode","number",["number","number"]);this.QTS_bjson_decode=this.module.cwrap("QTS_bjson_decode","number",["number","number"])}};export{n as QuickJSAsyncFFI};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __alran_cR } from "module"; import { basename as __alran_basename, dirname as __alran_dirname, join as __alran_join } from "path"; import { fileURLToPath as __alran_fileURLToPath, pathToFileURL as __alran_pathToFileURL } from "url"; const __alran_tuiCurrentModuleDir = __alran_dirname(__alran_fileURLToPath(import.meta.url)); const __alran_tuiPackageRoot = __alran_basename(__alran_tuiCurrentModuleDir) === "chunks" ? __alran_dirname(__alran_tuiCurrentModuleDir) : __alran_tuiCurrentModuleDir; const __alran_tuiPackageEntryUrl = __alran_pathToFileURL(__alran_join(__alran_tuiPackageRoot, "cli.js")).href; const require = __alran_cR(__alran_tuiPackageEntryUrl); const __dirname = __alran_tuiPackageRoot;
|
|
2
|
-
import{c as G,d as L,e as f,f as R,g as O,h as A,i as P}from"./chunk-
|
|
2
|
+
import{c as G,d as L,e as f,f as R,g as O,h as A,i as P}from"./chunk-C6LAAFG2.js";import"./chunk-UJCAE7SG.js";import{d as b,e as M,f as I,h as S,j as w}from"./chunk-VLXX22YO.js";import{a as T}from"./chunk-7XYOYZX2.js";import"./chunk-XSEU4WQD.js";import"./chunk-XQK7JM66.js";var W=0;var m=(e,a,n)=>{const i=new I;(async()=>{const t={role:"assistant",content:[],api:"google-generative-ai",provider:e.provider,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"stop",timestamp:Date.now()};try{const r=n?.apiKey;if(!r){throw new Error(`No API key for provider: ${e.provider}`)}const u=U(e,r,n?.headers);let g=H(e,a,n);const y=await n?.onPayload?.(g,e);if(y!==void 0){g=y}const E=await u.models.generateContentStream(g);i.push({type:"start",partial:t});let o=null;const v=t.content;const l=()=>v.length-1;for await(const d of E){t.responseId||=d.responseId;const c=d.candidates?.[0];if(c?.content?.parts){for(const s of c.content.parts){if(s.text!==void 0){const h=L(s);if(!o||h&&o.type!=="thinking"||!h&&o.type!=="text"){if(o){if(o.type==="text"){i.push({type:"text_end",contentIndex:v.length-1,content:o.text,partial:t})}else{i.push({type:"thinking_end",contentIndex:l(),content:o.thinking,partial:t})}}if(h){o={type:"thinking",thinking:"",thinkingSignature:void 0};t.content.push(o);i.push({type:"thinking_start",contentIndex:l(),partial:t})}else{o={type:"text",text:""};t.content.push(o);i.push({type:"text_start",contentIndex:l(),partial:t})}}if(o.type==="thinking"){o.thinking+=s.text;o.thinkingSignature=f(o.thinkingSignature,s.thoughtSignature);i.push({type:"thinking_delta",contentIndex:l(),delta:s.text,partial:t})}else{o.text+=s.text;o.textSignature=f(o.textSignature,s.thoughtSignature);i.push({type:"text_delta",contentIndex:l(),delta:s.text,partial:t})}}if(s.functionCall){if(o){if(o.type==="text"){i.push({type:"text_end",contentIndex:l(),content:o.text,partial:t})}else{i.push({type:"thinking_end",contentIndex:l(),content:o.thinking,partial:t})}o=null}const h=s.functionCall.id;const N=!h||t.content.some(x=>x.type==="toolCall"&&x.id===h);const B=N?`${s.functionCall.name}_${Date.now()}_${++W}`:h;const p={type:"toolCall",id:B,name:s.functionCall.name||"",arguments:s.functionCall.args??{},...s.thoughtSignature&&{thoughtSignature:s.thoughtSignature}};t.content.push(p);i.push({type:"toolcall_start",contentIndex:l(),partial:t});i.push({type:"toolcall_delta",contentIndex:l(),delta:JSON.stringify(p.arguments),partial:t});i.push({type:"toolcall_end",contentIndex:l(),toolCall:p,partial:t})}}}if(c?.finishReason){t.stopReason=P(c.finishReason);if(t.content.some(s=>s.type==="toolCall")){t.stopReason="toolUse"}}if(d.usageMetadata){t.usage={input:(d.usageMetadata.promptTokenCount||0)-(d.usageMetadata.cachedContentTokenCount||0),output:(d.usageMetadata.candidatesTokenCount||0)+(d.usageMetadata.thoughtsTokenCount||0),cacheRead:d.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,totalTokens:d.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}};b(e,t.usage)}}if(o){if(o.type==="text"){i.push({type:"text_end",contentIndex:l(),content:o.text,partial:t})}else{i.push({type:"thinking_end",contentIndex:l(),content:o.thinking,partial:t})}}if(n?.signal?.aborted){throw new Error("Request was aborted")}if(t.stopReason==="aborted"||t.stopReason==="error"){throw new Error("An unknown error occurred")}i.push({type:"done",reason:t.stopReason,message:t});i.end()}catch(r){S(n?.onProviderError,r,e);for(const u of t.content){if("index"in u){delete u.index}}t.stopReason=n?.signal?.aborted?"aborted":"error";t.errorMessage=r instanceof Error?r.message:JSON.stringify(r);i.push({type:"error",reason:t.stopReason,error:t});i.end()}})();return i};var X=(e,a,n)=>{const i=n?.apiKey;if(!i){throw new Error(`No API key for provider: ${e.provider}`)}const t=w(e,n,i);if(!n?.reasoning){return m(e,a,{...t,thinking:{enabled:false}})}const r=M(e,n.reasoning);const u=r==="off"?"high":r;const g=e;if(C(g)||_(g)||k(g)){return m(e,a,{...t,thinking:{enabled:true,level:D(u,g)}})}return m(e,a,{...t,thinking:{enabled:true,budgetTokens:F(g,u,n.thinkingBudgets)}})};function U(e,a,n){const i={};if(e.baseUrl){i.baseUrl=e.baseUrl;i.apiVersion=""}if(e.headers||n){i.headers={...e.headers,...n}}return new G({apiKey:a,httpOptions:Object.keys(i).length>0?i:void 0})}function H(e,a,n={}){const i=R(e,a);const t={};if(n.temperature!==void 0){t.temperature=n.temperature}if(n.maxTokens!==void 0){t.maxOutputTokens=n.maxTokens}const r={...Object.keys(t).length>0&&t,...a.systemPrompt&&{systemInstruction:T(a.systemPrompt)},...a.tools&&a.tools.length>0&&{tools:O(a.tools)}};if(a.tools&&a.tools.length>0&&n.toolChoice){r.toolConfig={functionCallingConfig:{mode:A(n.toolChoice)}}}else{r.toolConfig=void 0}if(n.thinking?.enabled&&e.reasoning){const g={includeThoughts:true};if(n.thinking.level!==void 0){g.thinkingLevel=n.thinking.level}else if(n.thinking.budgetTokens!==void 0){g.thinkingBudget=n.thinking.budgetTokens}r.thinkingConfig=g}else if(e.reasoning&&n.thinking&&!n.thinking.enabled){r.thinkingConfig=$(e)}if(n.signal){if(n.signal.aborted){throw new Error("Request aborted")}r.abortSignal=n.signal}const u={model:e.id,contents:i,config:r};return u}function k(e){return/gemma-?4/.test(e.id.toLowerCase())}function C(e){return/gemini-3(?:\.\d+)?-pro/.test(e.id.toLowerCase())}function _(e){return/gemini-3(?:\.\d+)?-flash/.test(e.id.toLowerCase())}function $(e){if(C(e)){return{thinkingLevel:"LOW"}}if(_(e)){return{thinkingLevel:"MINIMAL"}}if(k(e)){return{thinkingLevel:"MINIMAL"}}return{thinkingBudget:0}}function D(e,a){if(C(a)){switch(e){case"minimal":case"low":return"LOW";case"medium":case"high":return"HIGH"}}if(k(a)){switch(e){case"minimal":case"low":return"MINIMAL";case"medium":case"high":return"HIGH"}}switch(e){case"minimal":return"MINIMAL";case"low":return"LOW";case"medium":return"MEDIUM";case"high":return"HIGH"}}function F(e,a,n){if(n?.[a]!==void 0){return n[a]}if(e.id.includes("2.5-pro")){const i={minimal:128,low:2048,medium:8192,high:32768};return i[a]}if(e.id.includes("2.5-flash-lite")){const i={minimal:512,low:2048,medium:8192,high:24576};return i[a]}if(e.id.includes("2.5-flash")){const i={minimal:128,low:2048,medium:8192,high:24576};return i[a]}return-1}export{m as streamGoogle,X as streamSimpleGoogle};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __alran_cR } from "module"; import { basename as __alran_basename, dirname as __alran_dirname, join as __alran_join } from "path"; import { fileURLToPath as __alran_fileURLToPath, pathToFileURL as __alran_pathToFileURL } from "url"; const __alran_tuiCurrentModuleDir = __alran_dirname(__alran_fileURLToPath(import.meta.url)); const __alran_tuiPackageRoot = __alran_basename(__alran_tuiCurrentModuleDir) === "chunks" ? __alran_dirname(__alran_tuiCurrentModuleDir) : __alran_tuiCurrentModuleDir; const __alran_tuiPackageEntryUrl = __alran_pathToFileURL(__alran_join(__alran_tuiPackageRoot, "cli.js")).href; const require = __alran_cR(__alran_tuiPackageEntryUrl); const __dirname = __alran_tuiPackageRoot;
|
|
2
|
-
import{a as c,b as S,c as m,d as E,e as k,f as R,g as _,h as w,i as A}from"./chunk-
|
|
2
|
+
import{a as c,b as S,c as m,d as E,e as k,f as R,g as _,h as w,i as A}from"./chunk-C6LAAFG2.js";import"./chunk-UJCAE7SG.js";import{d as y,e as L,f as G,h as M,j as b}from"./chunk-VLXX22YO.js";import{a as O}from"./chunk-7XYOYZX2.js";import"./chunk-XSEU4WQD.js";import"./chunk-XQK7JM66.js";var P="v1";var K="gcp-vertex-credentials";var W={THINKING_LEVEL_UNSPECIFIED:c.THINKING_LEVEL_UNSPECIFIED,MINIMAL:c.MINIMAL,LOW:c.LOW,MEDIUM:c.MEDIUM,HIGH:c.HIGH};var j=0;var C=(e,t,n)=>{const o=new G;(async()=>{const i={role:"assistant",content:[],api:"google-vertex",provider:e.provider,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"stop",timestamp:Date.now()};try{const a=q(n);const g=a?F(e,a,n?.headers):B(e,X(n),Q(n),n?.headers);let d=Y(e,t,n);const v=await n?.onPayload?.(d,e);if(v!==void 0){d=v}const U=await g.models.generateContentStream(d);o.push({type:"start",partial:i});let r=null;const T=i.content;const l=()=>T.length-1;for await(const u of U){i.responseId||=u.responseId;const h=u.candidates?.[0];if(h?.content?.parts){for(const s of h.content.parts){if(s.text!==void 0){const p=E(s);if(!r||p&&r.type!=="thinking"||!p&&r.type!=="text"){if(r){if(r.type==="text"){o.push({type:"text_end",contentIndex:T.length-1,content:r.text,partial:i})}else{o.push({type:"thinking_end",contentIndex:l(),content:r.thinking,partial:i})}}if(p){r={type:"thinking",thinking:"",thinkingSignature:void 0};i.content.push(r);o.push({type:"thinking_start",contentIndex:l(),partial:i})}else{r={type:"text",text:""};i.content.push(r);o.push({type:"text_start",contentIndex:l(),partial:i})}}if(r.type==="thinking"){r.thinking+=s.text;r.thinkingSignature=k(r.thinkingSignature,s.thoughtSignature);o.push({type:"thinking_delta",contentIndex:l(),delta:s.text,partial:i})}else{r.text+=s.text;r.textSignature=k(r.textSignature,s.thoughtSignature);o.push({type:"text_delta",contentIndex:l(),delta:s.text,partial:i})}}if(s.functionCall){if(r){if(r.type==="text"){o.push({type:"text_end",contentIndex:l(),content:r.text,partial:i})}else{o.push({type:"thinking_end",contentIndex:l(),content:r.thinking,partial:i})}r=null}const p=s.functionCall.id;const D=!p||i.content.some(I=>I.type==="toolCall"&&I.id===p);const H=D?`${s.functionCall.name}_${Date.now()}_${++j}`:p;const f={type:"toolCall",id:H,name:s.functionCall.name||"",arguments:s.functionCall.args??{},...s.thoughtSignature&&{thoughtSignature:s.thoughtSignature}};i.content.push(f);o.push({type:"toolcall_start",contentIndex:l(),partial:i});o.push({type:"toolcall_delta",contentIndex:l(),delta:JSON.stringify(f.arguments),partial:i});o.push({type:"toolcall_end",contentIndex:l(),toolCall:f,partial:i})}}}if(h?.finishReason){i.stopReason=A(h.finishReason);if(i.content.some(s=>s.type==="toolCall")){i.stopReason="toolUse"}}if(u.usageMetadata){i.usage={input:(u.usageMetadata.promptTokenCount||0)-(u.usageMetadata.cachedContentTokenCount||0),output:(u.usageMetadata.candidatesTokenCount||0)+(u.usageMetadata.thoughtsTokenCount||0),cacheRead:u.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,totalTokens:u.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}};y(e,i.usage)}}if(r){if(r.type==="text"){o.push({type:"text_end",contentIndex:l(),content:r.text,partial:i})}else{o.push({type:"thinking_end",contentIndex:l(),content:r.thinking,partial:i})}}if(n?.signal?.aborted){throw new Error("Request was aborted")}if(i.stopReason==="aborted"||i.stopReason==="error"){throw new Error("An unknown error occurred")}o.push({type:"done",reason:i.stopReason,message:i});o.end()}catch(a){M(n?.onProviderError,a,e);for(const g of i.content){if("index"in g){delete g.index}}i.stopReason=n?.signal?.aborted?"aborted":"error";i.errorMessage=a instanceof Error?a.message:JSON.stringify(a);o.push({type:"error",reason:i.stopReason,error:i});o.end()}})();return o};var ge=(e,t,n)=>{const o=b(e,n,void 0);if(!n?.reasoning){return C(e,t,{...o,thinking:{enabled:false}})}const i=L(e,n.reasoning);const a=i==="off"?"high":i;const g=e;if(x(g)||N(g)){return C(e,t,{...o,thinking:{enabled:true,level:ee(a,g)}})}return C(e,t,{...o,thinking:{enabled:true,budgetTokens:te(g,a,n.thinkingBudgets)}})};function B(e,t,n,o){return new m({vertexai:true,project:t,location:n,apiVersion:P,httpOptions:V(e,o)})}function F(e,t,n){return new m({vertexai:true,apiKey:t,apiVersion:P,httpOptions:V(e,n)})}function V(e,t){const n={};const o=J(e.baseUrl);if(o){n.baseUrl=o;n.baseUrlResourceScope=S.COLLECTION;if($(o)){n.apiVersion=""}}if(e.headers||t){n.headers={...e.headers,...t}}return Object.keys(n).length>0?n:void 0}function J(e){const t=e.trim();if(!t||t.includes("{location}")){return void 0}return t}function $(e){try{const t=new URL(e);return t.pathname.split("/").some(n=>/^v\d+(?:beta\d*)?$/.test(n))}catch{return/(?:^|\/)v\d+(?:beta\d*)?(?:\/|$)/.test(e)}}function q(e){const t=e?.apiKey?.trim();if(!t||t===K||z(t)){return void 0}return t}function z(e){return/^<[^>]+>$/.test(e)}function X(e){const t=e?.project||process.env.GOOGLE_CLOUD_PROJECT||process.env.GCLOUD_PROJECT;if(!t){throw new Error("Vertex AI requires a project ID. Set GOOGLE_CLOUD_PROJECT/GCLOUD_PROJECT or pass project in options.")}return t}function Q(e){const t=e?.location||process.env.GOOGLE_CLOUD_LOCATION;if(!t){throw new Error("Vertex AI requires a location. Set GOOGLE_CLOUD_LOCATION or pass location in options.")}return t}function Y(e,t,n={}){const o=R(e,t);const i={};if(n.temperature!==void 0){i.temperature=n.temperature}if(n.maxTokens!==void 0){i.maxOutputTokens=n.maxTokens}const a={...Object.keys(i).length>0&&i,...t.systemPrompt&&{systemInstruction:O(t.systemPrompt)},...t.tools&&t.tools.length>0&&{tools:_(t.tools)}};if(t.tools&&t.tools.length>0&&n.toolChoice){a.toolConfig={functionCallingConfig:{mode:w(n.toolChoice)}}}else{a.toolConfig=void 0}if(n.thinking?.enabled&&e.reasoning){const d={includeThoughts:true};if(n.thinking.level!==void 0){d.thinkingLevel=W[n.thinking.level]}else if(n.thinking.budgetTokens!==void 0){d.thinkingBudget=n.thinking.budgetTokens}a.thinkingConfig=d}else if(e.reasoning&&n.thinking&&!n.thinking.enabled){a.thinkingConfig=Z(e)}if(n.signal){if(n.signal.aborted){throw new Error("Request aborted")}a.abortSignal=n.signal}const g={model:e.id,contents:o,config:a};return g}function x(e){return/gemini-3(?:\.\d+)?-pro/.test(e.id.toLowerCase())}function N(e){return/gemini-3(?:\.\d+)?-flash/.test(e.id.toLowerCase())}function Z(e){const t=e;if(x(t)){return{thinkingLevel:c.LOW}}if(N(t)){return{thinkingLevel:c.MINIMAL}}return{thinkingBudget:0}}function ee(e,t){if(x(t)){switch(e){case"minimal":case"low":return"LOW";case"medium":case"high":return"HIGH"}}switch(e){case"minimal":return"MINIMAL";case"low":return"LOW";case"medium":return"MEDIUM";case"high":return"HIGH"}}function te(e,t,n){if(n?.[t]!==void 0){return n[t]}if(e.id.includes("2.5-pro")){const o={minimal:128,low:2048,medium:8192,high:32768};return o[t]}if(e.id.includes("2.5-flash")){const o={minimal:128,low:2048,medium:8192,high:24576};return o[t]}return-1}export{C as streamGoogleVertex,ge as streamSimpleGoogleVertex};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __alran_cR } from "module"; import { basename as __alran_basename, dirname as __alran_dirname, join as __alran_join } from "path"; import { fileURLToPath as __alran_fileURLToPath, pathToFileURL as __alran_pathToFileURL } from "url"; const __alran_tuiCurrentModuleDir = __alran_dirname(__alran_fileURLToPath(import.meta.url)); const __alran_tuiPackageRoot = __alran_basename(__alran_tuiCurrentModuleDir) === "chunks" ? __alran_dirname(__alran_tuiCurrentModuleDir) : __alran_tuiCurrentModuleDir; const __alran_tuiPackageEntryUrl = __alran_pathToFileURL(__alran_join(__alran_tuiPackageRoot, "cli.js")).href; const require = __alran_cR(__alran_tuiPackageEntryUrl); const __dirname = __alran_tuiPackageRoot;
|
|
2
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s}from"./chunk-
|
|
2
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s}from"./chunk-PCL2CVVE.js";import"./chunk-ZQKVUPKA.js";import"./chunk-R44C5DM6.js";import"./chunk-XQK7JM66.js";export{c as ALRAN_LEGACY_NPM_PACKAGE_NAMES,b as ALRAN_NPM_PACKAGE_NAME,a as ALRAN_PUBLIC_NPM_REGISTRY,m as bindAlranNpmCommandToRuntime,k as buildAlranPackageManagerCommand,g as classifyAlranInstallPath,j as classifyNpmGlobalInstall,n as createAlranNpmRuntimeEnvironment,f as detectAlranInstallSource,d as isLegacyAlranPackageName,e as isManagedAlranInstallRoot,s as parseAlranPackageName,i as resolveAlranNpmDistTag,h as resolveAlranNpmDistribution,r as resolveAlranNpmPrefixInstall,p as resolveAlranPackageName,q as resolveInstalledAlranPackageVersion,l as resolveLatestAlranRegistryVersion,o as runAlranPackageManagerCommand};
|