@mcp-use/cli 4.0.0-beta.9 → 4.0.1-canary.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/dist/bin.js +1 -1
- package/dist/chunk-3XW44DRS.js +1 -0
- package/dist/chunk-F5XPOFT7.js +1 -0
- package/dist/{chunk-DB3E6LBX.js → chunk-FLGSKQGU.js} +2 -2
- package/dist/chunk-HKE5UI5S.js +90 -0
- package/dist/chunk-ICHICRCP.js +4 -0
- package/dist/chunk-ISAAAHEM.js +14 -0
- package/dist/chunk-LNASFQWW.js +1 -0
- package/dist/chunk-VUVLJMYY.js +11 -0
- package/dist/commands/build.js +5 -5
- package/dist/commands/client.js +1 -1
- package/dist/commands/deploy.js +73 -1
- package/dist/commands/deployments.js +59 -6
- package/dist/commands/dev.js +2 -2
- package/dist/commands/identity.js +38 -2
- package/dist/commands/organizations.js +43 -2
- package/dist/commands/screenshot.js +48 -3
- package/dist/commands/servers.js +90 -2
- package/dist/commands/start.js +1 -1
- package/dist/commands/typecheck.js +1 -1
- package/dist/index.js +1 -1
- package/dist/node-bridge-WOT2W5YZ.js +1 -0
- package/dist/{start-CGEGBZOH.js → start-PCNMGPDW.js} +1 -1
- package/dist/tunnel-FOJUZGIJ.js +1 -0
- package/package.json +7 -4
- package/types/vite-client.d.ts +3 -0
- package/dist/chunk-ALPMVGHI.js +0 -3
- package/dist/chunk-FEEM7DWN.js +0 -37
- package/dist/chunk-LHNHT6HO.js +0 -8
- package/dist/chunk-N6R74JIF.js +0 -33
- package/dist/chunk-OVFUQAEG.js +0 -1
- package/dist/chunk-ZELLSKD2.js +0 -1
- package/dist/node-bridge-JJIA6K5P.js +0 -1
- package/dist/tunnel-AQ2WE7EL.js +0 -1
package/dist/chunk-N6R74JIF.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import{a,b as E,c as L,d as p,e as N,f as S,g as U,h,i as k,j as w,l as R}from"./chunk-LHNHT6HO.js";import{createHash as ie}from"crypto";import{rm as J}from"fs/promises";import{join as P}from"path";import{parseArgs as b}from"util";import{spawn as K}from"child_process";import{readFileSync as W}from"fs";import{chmod as z,mkdir as q}from"fs/promises";import{dirname as V,join as y,resolve as Y}from"path";import{pathToFileURL as M}from"url";var g=y(R,"client-sdk"),m="@mcp-use/client",Z="^2.0.0-alpha.0",Q=[`[mcp-use] ${m} is not installed.`,"The `mcp-use client` and `mcp-use screenshot` commands require it.","Install it in your project:",""," npm install @mcp-use/client",""," pnpm add @mcp-use/client",""," bun add @mcp-use/client"].join(`
|
|
2
|
-
`);async function X(e){let n=Y(e);for(;;){if(await h(y(n,"package.json")))return n;let t=V(n);if(t===n)return;n=t}}async function D(){try{return await oe()}catch(e){if(!j(e))throw e;let n=await ee();try{return n.location==="sandbox"?await se():await re(n.projectRoot)}catch(t){throw j(t)?new a(Q):t}}}async function ee(){let e=ne(),n=`${m}@${e}`,t=await X(process.cwd());if(process.stderr.write(`[mcp-use] installing ${m}\u2026
|
|
3
|
-
`),t!==void 0){let[s,c]=te(n);if(await I(s,c,t)!==0)throw new E("client_install_failed",`Failed to install ${m}.`);return{location:"project",projectRoot:t}}await q(g,{recursive:!0,mode:448}),await z(g,448);let r=y(g,"package.json");if(await h(r)||await w(r,{private:!0,dependencies:{[m]:e}}),await I("npm",["install",n],g)!==0)throw new E("client_install_failed",`Failed to install ${m}.`);return{location:"sandbox"}}function te(e){let n=process.env.npm_config_user_agent??"";return n.startsWith("pnpm/")?["pnpm",["add",e]]:n.startsWith("bun/")?["bun",["add",e]]:["npm",["install",e]]}function ne(){for(let e of["../package.json","../../package.json"])try{let n=W(new URL(e,import.meta.url),"utf8"),t=JSON.parse(n);if(t.name!=="mcp-use")continue;let r=t.peerDependencies?.[m];if(typeof r=="string"&&r.length>0)return r}catch{}return Z}async function oe(){return import("@mcp-use/client")}async function re(e){let n=M(y(e,"package.json")).href;return import(await import.meta.resolve(m,n))}async function se(){let e=y(g,"node_modules",m,"dist","index.js");return await import(M(e).href)}function j(e){if(!(e instanceof Error))return!1;let n=e.code;return n==="ERR_MODULE_NOT_FOUND"||n==="MODULE_NOT_FOUND"?e.message.includes(m)||e.message.includes("Cannot find package"):!1}function I(e,n,t){return new Promise((r,o)=>{let s=K(e,n,{cwd:t,stdio:"inherit",shell:process.platform==="win32"});s.once("error",o),s.once("exit",(c,u)=>{r(u==="SIGINT"?130:c??1)})})}var B=P(R,"client"),_=P(B,"servers.json"),ae=`Usage: mcp-use client <command> [options]
|
|
4
|
-
|
|
5
|
-
Commands:
|
|
6
|
-
connect <name> <url> Connect and save an HTTP(S) MCP server
|
|
7
|
-
list List saved servers
|
|
8
|
-
remove <name> Remove a saved server
|
|
9
|
-
<name> Invoke tools/resources/prompts on a saved server
|
|
10
|
-
|
|
11
|
-
Connect options:
|
|
12
|
-
-H, --header <"Key: Value"> Static header (repeatable)
|
|
13
|
-
--no-oauth Skip OAuth on authorization challenges
|
|
14
|
-
--auth-timeout <ms> OAuth wait timeout (default: 300000)
|
|
15
|
-
--protocol <auto|2026-07-28|2025-11-25>
|
|
16
|
-
--open Open the OAuth URL in a browser without prompting
|
|
17
|
-
--no-open Print the OAuth URL only
|
|
18
|
-
--json Emit machine-readable output
|
|
19
|
-
|
|
20
|
-
Saved server commands:
|
|
21
|
-
mcp-use client <name> tools list|describe|call ...
|
|
22
|
-
mcp-use client <name> resources list|read ...
|
|
23
|
-
mcp-use client <name> prompts list|get ...
|
|
24
|
-
mcp-use client <name> auth status|logout
|
|
25
|
-
|
|
26
|
-
Examples:
|
|
27
|
-
mcp-use client connect linear https://mcp.linear.app/mcp
|
|
28
|
-
mcp-use client linear tools list
|
|
29
|
-
mcp-use client linear tools call search_issues query="open bugs"`;async function _e(e){if(e.includes("--help")||e.includes("-h"))return console.log(ae),0;let n=L(e);try{let t=e[0];if(t==="connect")return await ce(e.slice(1),n);if(t==="list")return await le(e.slice(1),n);if(t==="remove")return await ue(e.slice(1),n);if(t===void 0)throw new a("Usage: mcp-use client <connect|list|remove|name>");return await pe(t,e.slice(1),n)}catch(t){return N(t instanceof TypeError?new a(t.message):t,n)}}async function ce(e,n){let{values:t,positionals:r}=b({args:[...e],allowPositionals:!0,strict:!0,options:{header:{type:"string",short:"H",multiple:!0},"no-oauth":{type:"boolean"},"auth-timeout":{type:"string"},protocol:{type:"string",default:"auto"},open:{type:"boolean"},"no-open":{type:"boolean"},json:{type:"boolean"}}});if(t.open===!0&&t["no-open"]===!0)throw new a("Cannot combine --open and --no-open.");if(r.length!==2)throw new a("Usage: mcp-use client connect <name> <url>");let[o,s]=r;he(o);let c=new URL(s);if(!["http:","https:"].includes(c.protocol))throw new a("Client URLs must use http or https.");let u=we(t.protocol),l=F(t["auth-timeout"]??"300000","--auth-timeout"),i=await C();if(i.servers[o]!==void 0)throw new a(`Saved server already exists: ${o}`);let d={headers:fe(t.header??[])},f={url:c.href,oauth:t["no-oauth"]!==!0,protocol:u};return await(await $(o,f,d,l,me({open:t.open===!0,noOpen:t["no-open"]===!0,json:n}))).disconnect(),i.servers[o]=f,await w(_,i),await w(x(o),d),p({name:o,url:f.url,protocol:u},n,`Connected and saved ${o}.`),0}async function le(e,n){v(e);let t=await C(),r=Object.entries(t.servers).map(([o,s])=>({name:o,...s}));return p(r,n,r.map(o=>`${o.name} ${o.url}`).join(`
|
|
30
|
-
`)||"No saved servers."),0}async function ue(e,n){let{values:t,positionals:r}=b({args:[...e],allowPositionals:!0,strict:!0,options:{yes:{type:"boolean"},json:{type:"boolean"}}}),o=T(r,"mcp-use client remove <name>");if(!await S(`Remove saved server ${o}?`,{yes:t.yes===!0,json:n}))return 0;let s=await C();return delete s.servers[o],await w(_,s),await J(A(o),{recursive:!0,force:!0}),p({removed:o},n,`Removed ${o}.`),0}async function pe(e,n,t){let o=(await C()).servers[e];if(o===void 0)throw new a(`Unknown saved server: ${e}. Run \`mcp-use client connect ${e} <url>\`.`);let s=n[0],c=n[1];if(s==="auth"){if(c==="status"){v(n.slice(2));let i=await h(O(e));return p({name:e,oauth:o.oauth,authenticated:i},t,i?"Authenticated.":"No saved OAuth session."),0}if(c==="logout"){let{values:i,positionals:d}=b({args:[...n.slice(2)],allowPositionals:!0,strict:!0,options:{yes:{type:"boolean"},json:{type:"boolean"}}});if(d.length!==0)throw new a(`Usage: mcp-use client ${e} auth logout`);return await S(`Delete OAuth credentials for ${e}?`,{yes:i.yes===!0,json:t})&&(await J(O(e),{recursive:!0,force:!0}),p({loggedOut:e},t,`Logged out ${e}.`)),0}}let u=await k(x(e),{}),l=await $(e,o,u,3e5);try{if(s==="tools"){if(c==="list"){v(n.slice(2));let i=await l.listTools();return p(i,t,i.map(d=>`${d.name} ${d.description??""}`).join(`
|
|
31
|
-
`)),0}if(c==="describe"){let i=T(n.slice(2),`mcp-use client ${e} tools describe <tool>`),d=(await l.listTools()).find(f=>f.name===i);if(d===void 0)throw new a(`Tool not found: ${i}`);return p(d,t),0}if(c==="call")return await de(l,e,n.slice(2),t)}if(s==="resources"){if(c==="list"){v(n.slice(2));let i=await l.listResources();return p(i,t),0}if(c==="read"){let i=T(n.slice(2),`mcp-use client ${e} resources read <uri>`);return p(await l.readResource(i),t),0}}if(s==="prompts"){if(c==="list")return v(n.slice(2)),p(await l.listPrompts(),t),0;if(c==="get"){let i=n[2];if(i===void 0)throw new a(`Usage: mcp-use client ${e} prompts get <prompt> [args]`);return p(await l.getPrompt(i,H(n.slice(3))),t),0}}throw new a(`Usage: mcp-use client ${e} <tools|resources|prompts|auth> ...`)}finally{await l.disconnect()}}async function de(e,n,t,r){let o=t[0];if(o===void 0)throw new a(`Usage: mcp-use client ${n} tools call <tool> [args]`);let{values:s,positionals:c}=b({args:[...t.slice(1)],allowPositionals:!0,strict:!0,options:{timeout:{type:"string",default:"30000"},json:{type:"boolean"}}}),u=F(s.timeout,"--timeout"),l=await e.callTool(o,H(c),{timeout:u});if(l.isError===!0)throw new Error(`Tool ${o} returned an error: ${JSON.stringify(l)}`);return p(l,r),0}async function $(e,n,t,r,o=process.stdin.isTTY?"ask":"never"){let{createOAuthProvider:s,MCPClient:c}=await D(),u=O(e),l=n.oauth?await s(n.url,{baseDir:u,authTimeoutMs:r,storageKeyPrefix:`mcp-use-cli:${e}`,openBrowser:async f=>{process.stderr.write(`Open this URL to authenticate:
|
|
32
|
-
${f}
|
|
33
|
-
`),o!=="never"&&(o==="ask"&&!await S("Open in browser?",{yes:!1,json:!1})||U(f))}}):void 0,i=n.protocol==="auto"?"auto":{pin:n.protocol};return new c({mcpServers:{[e]:{url:n.url,...t.headers!==void 0?{headers:t.headers}:{},...l!==void 0?{authProvider:l}:{oauth:!1},protocolNegotiation:i}}}).connect(e)}async function Ae(e,n=3e5){let r=(await C()).servers[e];if(r===void 0)throw new a(`Unknown saved server: ${e}`);let o=await k(x(e),{});return $(e,r,o,n)}async function xe(e,n){return $("screenshot",{url:e,oauth:!1,protocol:"auto"},{headers:n},3e5)}function H(e){if(e.length===0)return{};if(e.length===1&&e[0]?.trimStart().startsWith("{")){let t=JSON.parse(e[0]);if(t===null||Array.isArray(t)||typeof t!="object")throw new a("The JSON argument must be an object.");return t}let n={};for(let t of e){let r=t.indexOf(":="),o=t.indexOf("="),s=r>=0?r:o,c=r>=0?2:1;if(s<=0)throw new a(`Expected key=value or key:=<json>, received: ${t}`);let u=t.slice(0,s).replace(/^--/,""),l=t.slice(s+c);n[u]=r>=0?JSON.parse(l):l}return n}function me(e){return e.json||e.noOpen||!process.stdin.isTTY?"never":e.open?"always":"ask"}function fe(e){let n={};for(let t of e){let r=t.indexOf(":");if(r<=0)throw new a(`Invalid header: ${t}`);n[t.slice(0,r).trim()]=t.slice(r+1).trim()}return n}function we(e){if(e!=="auto"&&e!=="2026-07-28"&&e!=="2025-11-25")throw new a(`Invalid protocol: ${e}`);return e}function F(e,n){let t=Number(e);if(!Number.isInteger(t)||t<=0)throw new a(`${n} must be a positive integer.`);return t}function he(e){if(!/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/.test(e))throw new a("Server names must be 1-64 filesystem-safe letters, numbers, dots, dashes, or underscores.")}async function C(){return k(_,{servers:{}})}function A(e){return P(B,"credentials",ie("sha256").update(e).digest("hex"))}function x(e){return P(A(e),"credentials.json")}function O(e){return P(A(e),"oauth")}function v(e){b({args:[...e],allowPositionals:!1,strict:!0,options:{json:{type:"boolean"}}})}function T(e,n){if(e.length!==1)throw new a(`Usage: ${n}`);return e[0]}export{_e as a,Ae as b,xe as c,H as d};
|
package/dist/chunk-OVFUQAEG.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{mkdir as U,readFile as L,writeFile as O}from"fs/promises";import{spawn as R}from"child_process";import{dirname as z}from"path";var D="https://local.mcp-use.run";function W(){return process.env.MCP_USE_TUNNEL_API??D}var y=1e3,q=3e4;function H(h){let i,o=null,u,l,d=!1,c,m=y,M=e=>new Promise(n=>{setTimeout(n,e)}),$=()=>{i!==void 0&&"markShutdown"in i&&typeof i.markShutdown=="function"&&i.markShutdown()},b=async e=>{try{await fetch(`${W()}/api/tunnels/${e}`,{method:"DELETE",signal:AbortSignal.timeout(2e3)})}catch{}},P=async()=>{try{let e=await L(h,"utf8"),n=JSON.parse(e);return typeof n.subdomain=="string"?n.subdomain:void 0}catch{return}},_=async e=>{try{await U(z(h),{recursive:!0}),await O(h,JSON.stringify({subdomain:e},null,2),"utf8")}catch(n){console.warn(`[mcp-use] failed to save tunnel subdomain: ${n instanceof Error?n.message:String(n)}`)}},E=()=>{},w=(e,n)=>new Promise((t,f)=>{console.log(`[mcp-use] starting tunnel for port ${e}\u2026`);let k=process.env.npm_config_user_agent??"",[F,x]=k.startsWith("pnpm/")?["pnpm",["--silent","dlx","@mcp-use/tunnel",String(e)]]:k.startsWith("bun/")?["bunx",["@mcp-use/tunnel",String(e)]]:["npx",["--yes","--prefer-offline","@mcp-use/tunnel",String(e)]];n!==void 0&&x.push("--subdomain",n);let a=R(F,x,{stdio:["ignore","pipe","pipe"],shell:process.platform==="win32"}),p=!1,S=!1,I=()=>{S=!0};a.markShutdown=I,a.stdout.on("data",r=>{let s=r.toString(),N=s.includes("Shutting down")||s.includes("\u{1F6D1}"),C=s.includes("\u2716")||s.includes("Error:");!S&&!N&&!C&&process.stdout.write(s);let v=s.match(/https?:\/\/([a-z0-9-]+\.[a-z0-9.-]+)/i);if(v!==null&&!p){let B=v[0],A=v[1]??"",g=A.match(/^([a-z0-9-]+)\./i)?.[1]??A.split(".")[0]??"";/^[a-z0-9-]+$/i.test(g)||(console.warn(`[mcp-use] warning: extracted subdomain "${g}" does not match expected format`),g=""),p=!0,clearTimeout(T),t({url:B,subdomain:g,process:a})}}),a.stderr.on("data",r=>{let s=r.toString();!S&&!s.includes("INFO")&&!s.includes("bore_cli")&&!s.includes("Shutting down")&&!/npm warn Unknown (?:env|project|user|builtin) config/.test(s)&&process.stderr.write(r)}),a.on("error",r=>{p||(clearTimeout(T),f(new Error(`Failed to start tunnel: ${r.message}`)))}),a.on("exit",r=>{r!==0&&r!==null&&!p&&(clearTimeout(T),f(new Error(`Tunnel process exited with code ${r}`))),i===a&&(i=void 0,o=null,d?u=void 0:E())});let T=setTimeout(()=>{p||(a.kill(),f(new Error("Tunnel setup timed out")))},3e4)});return E=()=>{d||l===void 0||o!==null||c===void 0&&(c=(async()=>{for(;!d&&l!==void 0&&o===null;){console.log("[mcp-use] tunnel disconnected, restarting\u2026");let e=u??await P();try{e!==void 0&&await b(e);let n;try{n=await w(l,e)}catch(t){if(e!==void 0)console.log(`[mcp-use] subdomain "${e}" unavailable, requesting a new one\u2026`),n=await w(l,void 0);else throw t}i=n.process,o=n.url,u=n.subdomain,await _(n.subdomain),m=y;return}catch(n){console.warn(`[mcp-use] tunnel restart failed: ${n instanceof Error?n.message:String(n)}`),await M(m),m=Math.min(m*2,q)}}})().finally(()=>{c=void 0}))},{status(){return{url:o}},async start(e){if(d=!1,l=e,o!==null)return{url:o,subdomain:u??""};let n=await P();n!==void 0&&(console.log(`[mcp-use] found existing subdomain: ${n}`),await b(n));let t;try{t=await w(e,n)}catch(f){if(n!==void 0)console.log(`[mcp-use] subdomain "${n}" unavailable, requesting a new one\u2026`),t=await w(e,void 0);else throw f}return i=t.process,o=t.url,u=t.subdomain,await _(t.subdomain),{url:t.url,subdomain:t.subdomain}},async stop(){d=!0,$(),c!==void 0&&await c,u!==void 0&&await b(u),i!==void 0&&(i.kill("SIGINT"),i=void 0),l=void 0,o=null,u=void 0,m=y}}}export{W as a,H as b};
|
package/dist/chunk-ZELLSKD2.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as o,i as g,j as c,k as l,l as f}from"./chunk-LHNHT6HO.js";import{join as C}from"path";var d=C(f,"config.json");function p(){return(process.env.MCP_USE_CLOUD_API_URL??"https://cloud.manufact.com/api/v1").replace(/\/+$/,"").replace(/\/api\/v1$/,"")+"/api/v1"}function z(){return p().replace(/\/api\/v1$/,"")}async function m(){return g(d,{})}async function I(i){await c(d,i)}async function O(){await l(d)}function _(i,t){let n=i.filter(e=>e.id===t||e.slug===t);if(n.length!==1)throw new o(n.length===0?"organization_not_found":"organization_ambiguous",`Organization not found: ${t}`);return n[0]}var s=class i{#n;#t;constructor(t,n){this.#n=t,this.#t=n}static async create(t){let n=await m(),e=process.env.MCP_USE_API_KEY??n.apiKey;if(e===void 0||e==="")throw new o("not_authenticated","Not logged in. Run `mcp-use login`.");return new i(e,t??n.orgId)}static withApiKey(t){return new i(t)}async request(t,n={}){let e=n.organizationId??this.#t,r=await fetch(`${p()}${t}`,{...n,headers:{Accept:"application/json","x-api-key":this.#n,...e!==void 0?{"x-profile-id":e}:{},...n.body!==void 0?{"Content-Type":"application/json"}:{},...n.headers}}),u=await r.text(),a;try{a=u===""?void 0:JSON.parse(u)}catch{a=u}if(!r.ok)throw new o(r.status===401?"not_authenticated":r.status===403?"forbidden":"cloud_api_error",h(a)??`Cloud API request failed (${r.status}).`,{status:r.status});return a}async identity(){let t=await this.request("/test-auth");return{userId:t.user_id,email:t.email,organizations:t.profiles.map(n=>({id:n.id,name:n.profile_name,slug:n.slug,role:n.role})),defaultOrganizationId:t.default_profile_id}}async setDefaultOrganization(t){await this.request(`/organizations/${t}/set-default`,{method:"POST"})}};async function P(i){let t=await m(),n=await(await s.create()).identity(),e=i!==void 0?_(n.organizations,i):n.organizations.find(r=>r.id===(t.orgId??n.defaultOrganizationId));if(e===void 0)throw new o("organization_required","No active organization. Run `mcp-use org use <id-or-slug>`.");return{api:await s.create(e.id),organizationId:e.id}}function h(i){if(typeof i=="string"&&i!=="")return i;if(!(i===null||typeof i!="object"))for(let t of["message","error","detail"]){let n=i[t];if(typeof n=="string"&&n!=="")return n}}export{z as a,m as b,I as c,O as d,_ as e,s as f,P as g};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function b(e,c){return async(a,i,d)=>{typeof d=="function"&&(d=void 0);let l=!1,t=new AbortController;i.on("close",()=>{l||t.abort()}),i.destroyed===!0&&t.abort();let s;try{let n=await w(a,d,{signal:t.signal});s=await e.fetch(n,{...a.auth!==void 0&&{authInfo:a.auth},...d!==void 0&&{parsedBody:d}})}catch(n){try{c?.onerror?.(n instanceof Error?n:new Error(String(n)))}catch{}s=y(m(d))}let r={};for(let[n,f]of s.headers)r[n]=f;if(i.writeHead(s.status,r),s.body===null){l=!0,i.end();return}let o,u=()=>{o?.(),o=void 0},h=()=>new Promise(n=>{o=n});i.on("drain",u);let p=new Promise(n=>{t.signal.addEventListener("abort",()=>n(),{once:!0})});try{for await(let n of s.body){if(t.signal.aborted)break;let f=n instanceof Uint8Array?n:new Uint8Array(n);i.write(f)===!1&&await Promise.race([h(),p])}}catch{}l=!0,i.end()}}async function w(e,c,a){let i=(e.method??"GET").toUpperCase(),l=`http://${g(e.headers.host)??g(e.headers[":authority"])??"localhost"}${e.url??"/"}`,t=new Headers;for(let[r,o]of Object.entries(e.headers))if(!(o===void 0||r.startsWith(":")))if(Array.isArray(o))for(let u of o)t.append(r,u);else t.set(r,o);let s;if(i!=="GET"&&i!=="HEAD")if(c===void 0){let r=new TextDecoder,o="";for await(let u of e)o+=typeof u=="string"?u:r.decode(u,{stream:!0});o+=r.decode(),o.length>0&&(s=o)}else{let r=JSON.stringify(c);t.delete("content-encoding"),t.delete("transfer-encoding"),r===void 0?t.delete("content-length"):(s=r,t.set("content-length",String(new TextEncoder().encode(r).byteLength)))}return new Request(l,{method:i,headers:t,...a?.signal!==void 0&&{signal:a.signal},...s!==void 0&&{body:s}})}function g(e){return Array.isArray(e)?e[0]:e}function m(e){if(e===null||typeof e!="object"||Array.isArray(e))return null;let{method:c,id:a}=e;return typeof c!="string"?null:typeof a=="string"||typeof a=="number"?a:null}function y(e){return Response.json({jsonrpc:"2.0",error:{code:-32603,message:"Internal server error"},id:e},{status:500})}export{b as toNodeHandler,w as toWebRequest};
|
package/dist/tunnel-AQ2WE7EL.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b}from"./chunk-OVFUQAEG.js";export{b as createTunnelManager,a as tunnelApiBase};
|