@mcp-use/inspector 0.26.0 → 0.26.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/dist/cdn/inspector.js +12 -12
- package/dist/client/index.js +31 -31
- package/dist/web/assets/{browser-CqnU_bMs.js → browser-CUjguYn6.js} +3 -3
- package/dist/web/assets/{chunk-RJUJMGGE-Ckike6v2.js → chunk-6E445R5C-ny1rw8Le.js} +1 -1
- package/dist/web/assets/{chunk-RPN2XO5I-BsQOpC8p.js → chunk-RPN2XO5I-_4a18lz2.js} +1 -1
- package/dist/web/assets/{chunk_array-Drzz3Bxj.js → chunk_array-cMM4je5w.js} +1 -1
- package/dist/web/assets/{client-CnWipjEl.js → client-DEFMLVFC.js} +1 -1
- package/dist/web/assets/{client-2CASVELM-BYYvwD7E.js → client-S6L7XHLF-Dqmt1wRx.js} +3 -3
- package/dist/web/assets/{dist-DXjAPY-W.js → dist-BG8NAFfu.js} +1 -1
- package/dist/web/assets/{dist-CFOVbGE_.js → dist-CKth7ANk.js} +1 -1
- package/dist/web/assets/{dist-jBWD8iGG.js → dist-YxwKnKYL.js} +1 -1
- package/dist/web/assets/{function_calling-BLGGrcJY.js → function_calling-XyGNNvjR.js} +1 -1
- package/dist/web/assets/{index-DnLjyl1f.js → index-zqVFP8t5.js} +10 -10
- package/dist/web/assets/{llms-CUFNg0bG.js → llms-DmE4p8kW.js} +1 -1
- package/dist/web/assets/messages-DmWRSzWI.js +1 -0
- package/dist/web/assets/react-Cg35ZZKt.js +1 -0
- package/dist/web/assets/{rpc-logger-TPNV75J4-DaBpv6Xr.js → rpc-logger-TPNV75J4-BPgEimJH.js} +1 -1
- package/dist/web/assets/{stdio-IOUVQROQ-CeewE_Ia.js → stdio-LLTXMSZH-CQ-zxwTS.js} +1 -1
- package/dist/web/assets/{tools-Bn2uguc_.js → tools-DWDA-ZTt.js} +1 -1
- package/dist/web/index.html +4 -4
- package/package.json +4 -3
- package/dist/web/assets/messages-D9QOZWGX.js +0 -1
- package/dist/web/assets/react-DDmrI2D-.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Et as e,I as t,Lt as n,ct as r,ht as i,mr as a,on as o,rn as s,st as c}from"./index-
|
|
1
|
+
import{Et as e,I as t,Lt as n,ct as r,ht as i,mr as a,on as o,rn as s,st as c}from"./index-zqVFP8t5.js";import{A as l,D as u,u as d}from"./function_calling-XyGNNvjR.js";function f(e,t){if(e.function===void 0)return;let n;if(t?.partial)try{n=o(e.function.arguments??`{}`)}catch{return}else try{n=JSON.parse(e.function.arguments)}catch(t){throw new l([`Function "${e.function.name}" arguments:`,``,e.function.arguments,``,`are not valid JSON.`,`Error: ${t.message}`].join(`
|
|
2
2
|
`))}let r={name:e.function.name,args:n,type:`tool_call`};return t?.returnId&&(r.id=e.id),r}function p(e){if(e.id===void 0)throw Error(`All OpenAI tool calls must have an "id" field.`);return{id:e.id,type:`function`,function:{name:e.name,arguments:JSON.stringify(e.args)}}}function m(e,t){return{name:e.function?.name,args:e.function?.arguments,id:e.id,error:t,type:`invalid_tool_call`}}var h=class extends u{static lc_name(){return`JsonOutputToolsParser`}returnId=!1;lc_namespace=[`langchain`,`output_parsers`,`openai_tools`];lc_serializable=!0;constructor(e){super(e),this.returnId=e?.returnId??this.returnId}_diff(){throw Error(`Not supported.`)}async parse(){throw Error(`Not implemented.`)}async parseResult(e){return await this.parsePartialResult(e,!1)}async parsePartialResult(e,t=!0){let n=e[0].message,r;if(s(n)&&n.tool_calls?.length?r=n.tool_calls.map(e=>{let{id:t,...n}=e;return this.returnId?{id:t,...n}:n}):n.additional_kwargs.tool_calls!==void 0&&(r=JSON.parse(JSON.stringify(n.additional_kwargs.tool_calls)).map(e=>f(e,{returnId:this.returnId,partial:t}))),!r)return[];let i=[];for(let e of r)if(e!==void 0){let t={type:e.name,args:e.args,id:e.id};i.push(t)}return i}},g=class extends h{static lc_name(){return`JsonOutputKeyToolsParser`}lc_namespace=[`langchain`,`output_parsers`,`openai_tools`];lc_serializable=!0;returnId=!1;keyName;returnSingle=!1;zodSchema;constructor(e){super(e),this.keyName=e.keyName,this.returnSingle=e.returnSingle??this.returnSingle,this.zodSchema=e.zodSchema}async _validateResult(e){if(this.zodSchema===void 0)return e;let n=await t(this.zodSchema,e);if(n.success)return n.data;throw new l(`Failed to parse. Text: "${JSON.stringify(e,null,2)}". Error: ${JSON.stringify(n.error?.issues)}`,JSON.stringify(e,null,2))}async parsePartialResult(e){let t=(await super.parsePartialResult(e)).filter(e=>e.type===this.keyName),n=t;if(t.length)return this.returnId||(n=t.map(e=>e.args)),this.returnSingle?n[0]:n}async parseResult(e){let t=(await super.parsePartialResult(e,!1)).filter(e=>e.type===this.keyName),n=t;if(t.length)return this.returnId||(n=t.map(e=>e.args)),this.returnSingle?this._validateResult(n[0]):await Promise.all(n.map(e=>this._validateResult(e)))}},_={};a(_,{JsonOutputKeyToolsParser:()=>g,JsonOutputToolsParser:()=>h,convertLangChainToolCallToOpenAI:()=>p,makeInvalidToolCall:()=>m,parseToolCall:()=>f});var v={};a(v,{BaseLLM:()=>y,LLM:()=>b});var y=class t extends d{lc_namespace=[`langchain`,`llms`,this._llmType()];async invoke(e,n){let r=t._convertInputToPromptValue(e);return(await this.generatePrompt([r],n,n?.callbacks)).generations[0][0].text}async*_streamResponseChunks(e,t,n){throw Error(`Not implemented.`)}_separateRunnableConfigFromCallOptionsCompat(e){let[t,n]=super._separateRunnableConfigFromCallOptions(e);return n.signal=t.signal,[t,n]}async*_streamIterator(n,r){if(this._streamResponseChunks===t.prototype._streamResponseChunks)yield this.invoke(n,r);else{let i=t._convertInputToPromptValue(n),[a,o]=this._separateRunnableConfigFromCallOptionsCompat(r),s=await e.configure(a.callbacks,this.callbacks,a.tags,this.tags,a.metadata,this.metadata,{verbose:this.verbose}),l={options:o,invocation_params:this?.invocationParams(o),batch_size:1},u=await s?.handleLLMStart(this.toJSON(),[i.toString()],a.runId,void 0,l,void 0,void 0,a.runName),d=new c({text:``});try{for await(let e of this._streamResponseChunks(i.toString(),o,u?.[0]))d=d?d.concat(e):e,typeof e.text==`string`&&(yield e.text)}catch(e){throw await Promise.all((u??[]).map(t=>t?.handleLLMError(e))),e}await Promise.all((u??[]).map(e=>e?.handleLLMEnd({generations:[[d]]})))}}async generatePrompt(e,t,n){let r=e.map(e=>e.toString());return this.generate(r,t,n)}invocationParams(e){return{}}_flattenLLMResult(e){let t=[];for(let n=0;n<e.generations.length;n+=1){let r=e.generations[n];if(n===0)t.push({generations:[r],llmOutput:e.llmOutput});else{let n=e.llmOutput?{...e.llmOutput,tokenUsage:{}}:void 0;t.push({generations:[r],llmOutput:n})}}return t}async _generateUncached(a,o,s,c){let l;if(c!==void 0&&c.length===a.length)l=c;else{let t=await e.configure(s.callbacks,this.callbacks,s.tags,this.tags,s.metadata,this.metadata,{verbose:this.verbose}),n={options:o,invocation_params:this?.invocationParams(o),batch_size:a.length};l=await t?.handleLLMStart(this.toJSON(),a,s.runId,void 0,n,void 0,void 0,s?.runName)}let u=!!l?.[0].handlers.find(n),d;if(u&&a.length===1&&this._streamResponseChunks!==t.prototype._streamResponseChunks)try{let e=await this._streamResponseChunks(a[0],o,l?.[0]),t;for await(let n of e)t=t===void 0?n:i(t,n);if(t===void 0)throw Error(`Received empty response from chat model call.`);d={generations:[[t]],llmOutput:{}},await l?.[0].handleLLMEnd(d)}catch(e){throw await l?.[0].handleLLMError(e),e}else{try{d=await this._generate(a,o,l?.[0])}catch(e){throw await Promise.all((l??[]).map(t=>t?.handleLLMError(e))),e}let e=this._flattenLLMResult(d);await Promise.all((l??[]).map((t,n)=>t?.handleLLMEnd(e[n])))}let f=l?.map(e=>e.runId)||void 0;return Object.defineProperty(d,r,{value:f?{runIds:f}:void 0,configurable:!0}),d}async _generateCached({prompts:t,cache:n,llmStringKey:i,parsedOptions:a,handledOptions:o,runId:s}){let c=await e.configure(o.callbacks,this.callbacks,o.tags,this.tags,o.metadata,this.metadata,{verbose:this.verbose}),l={options:a,invocation_params:this?.invocationParams(a),batch_size:t.length},u=await c?.handleLLMStart(this.toJSON(),t,s,void 0,l,void 0,void 0,o?.runName),d=[],f=(await Promise.allSettled(t.map(async(e,t)=>{let r=await n.lookup(e,i);return r??d.push(t),r}))).map((e,t)=>({result:e,runManager:u?.[t]})).filter(({result:e})=>e.status===`fulfilled`&&e.value!=null||e.status===`rejected`),p=[];await Promise.all(f.map(async({result:e,runManager:t},n)=>{if(e.status===`fulfilled`){let r=e.value;return p[n]=r.map(e=>(e.generationInfo={...e.generationInfo,tokenUsage:{}},e)),r.length&&await t?.handleLLMNewToken(r[0].text),t?.handleLLMEnd({generations:[r]},void 0,void 0,void 0,{cached:!0})}else return await t?.handleLLMError(e.reason,void 0,void 0,void 0,{cached:!0}),Promise.reject(e.reason)}));let m={generations:p,missingPromptIndices:d,startedRunManagers:u};return Object.defineProperty(m,r,{value:u?{runIds:u?.map(e=>e.runId)}:void 0,configurable:!0}),m}async generate(e,t,n){if(!Array.isArray(e))throw Error(`Argument 'prompts' is expected to be a string[]`);let r;r=Array.isArray(t)?{stop:t}:t;let[i,a]=this._separateRunnableConfigFromCallOptionsCompat(r);if(i.callbacks=i.callbacks??n,!this.cache)return this._generateUncached(e,a,i);let{cache:o}=this,s=this._getSerializedCacheKeyParametersForCall(a),{generations:c,missingPromptIndices:l,startedRunManagers:u}=await this._generateCached({prompts:e,cache:o,llmStringKey:s,parsedOptions:a,handledOptions:i,runId:i.runId}),d={};if(l.length>0){let t=await this._generateUncached(l.map(t=>e[t]),a,i,u===void 0?void 0:l.map(e=>u?.[e]));await Promise.all(t.generations.map(async(t,n)=>{let r=l[n];return c[r]=t,o.update(e[r],s,t)})),d=t.llmOutput??{}}return{generations:c,llmOutput:d}}_identifyingParams(){return{}}_modelType(){return`base_llm`}},b=class extends y{async _generate(e,t,n){return{generations:await Promise.all(e.map((e,r)=>this._call(e,{...t,promptIndex:r},n).then(e=>[{text:e}])))}}};export{p as a,g as i,v as n,m as o,_ as r,f as s,b as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{pn as e,tn as t,vn as n}from"./index-zqVFP8t5.js";export{t as AIMessage,n as HumanMessage,e as SystemMessage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{hr as e}from"./index-zqVFP8t5.js";export default e();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-QWQYAQCK-CyFuZlX8.js";import{br as e}from"./index-
|
|
1
|
+
import"./chunk-QWQYAQCK-CyFuZlX8.js";import{br as e}from"./index-zqVFP8t5.js";export{e as wrapTransportForLogging};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as e,n as t,o as n,r,t as i}from"./chunk-zsgVPwQN.js";import{t as a}from"./chunk-3GQAWCBQ-C-9Cm0Np.js";import{n as o}from"./chunk-QWQYAQCK-CyFuZlX8.js";import{g as s,n as c,r as l,t as u}from"./client-
|
|
1
|
+
import{a as e,n as t,o as n,r,t as i}from"./chunk-zsgVPwQN.js";import{t as a}from"./chunk-3GQAWCBQ-C-9Cm0Np.js";import{n as o}from"./chunk-QWQYAQCK-CyFuZlX8.js";import{g as s,n as c,r as l,t as u}from"./client-DEFMLVFC.js";import{a as d,o as f,r as p,t as m}from"./path-BzTN_bR6.js";var h={env:{},platform:`browser`,version:`v18.0.0`,versions:{node:`18.0.0`},cwd:()=>`/`,nextTick:(e,...t)=>queueMicrotask(()=>e(...t)),browser:!0},g=r({default:()=>w,exec:()=>v,execFile:()=>y,execFileSync:()=>C,execSync:()=>x,fork:()=>b,spawn:()=>_,spawnSync:()=>S});function _(){throw Error(`child_process.spawn is not available in browser environment`)}function v(){throw Error(`child_process.exec is not available in browser environment`)}function y(){throw Error(`child_process.execFile is not available in browser environment`)}function b(){throw Error(`child_process.fork is not available in browser environment`)}function x(){throw Error(`child_process.execSync is not available in browser environment`)}function S(){throw Error(`child_process.spawnSync is not available in browser environment`)}function C(){throw Error(`child_process.execFileSync is not available in browser environment`)}var w,T=t((()=>{w={spawn:_,exec:v,execFile:y,fork:b,execSync:x,spawnSync:S,execFileSync:C}})),E=i(((t,n)=>{n.exports=o,o.sync=s;var r=(f(),e(d));function i(e,t){var n=t.pathExt===void 0?{}.PATHEXT:t.pathExt;if(!n||(n=n.split(`;`),n.indexOf(``)!==-1))return!0;for(var r=0;r<n.length;r++){var i=n[r].toLowerCase();if(i&&e.substr(-i.length).toLowerCase()===i)return!0}return!1}function a(e,t,n){return!e.isSymbolicLink()&&!e.isFile()?!1:i(t,n)}function o(e,t,n){r.stat(e,function(r,i){n(r,r?!1:a(i,e,t))})}function s(e,t){return a(r.statSync(e),e,t)}})),D=i(((t,n)=>{n.exports=i,i.sync=a;var r=(f(),e(d));function i(e,t,n){r.stat(e,function(e,r){n(e,e?!1:o(r,t))})}function a(e,t){return o(r.statSync(e),t)}function o(e,t){return e.isFile()&&s(e,t)}function s(e,t){var n=e.mode,r=e.uid,i=e.gid,a=t.uid===void 0?process.getuid&&process.getuid():t.uid,o=t.gid===void 0?process.getgid&&process.getgid():t.gid,s=64,c=8,l=1,u=s|c;return n&l||n&c&&i===o||n&s&&r===a||n&u&&a===0}})),O=i(((e,t)=>{f();var n=globalThis.TESTING_WINDOWS?E():D();t.exports=r,r.sync=i;function r(e,t,i){if(typeof t==`function`&&(i=t,t={}),!i){if(typeof Promise!=`function`)throw TypeError(`callback not provided`);return new Promise(function(n,i){r(e,t||{},function(e,t){e?i(e):n(t)})})}n(e,t||{},function(e,n){e&&(e.code===`EACCES`||t&&t.ignoreErrors)&&(e=null,n=!1),i(e,n)})}function i(e,t){try{return n.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||e.code===`EACCES`)return!1;throw e}}})),k=i(((t,n)=>{var r={}.OSTYPE===`cygwin`||{}.OSTYPE===`msys`,i=(m(),e(p)),a=r?`;`:`:`,o=O(),s=e=>Object.assign(Error(`not found: ${e}`),{code:`ENOENT`}),c=(e,t)=>{let n=t.colon||a,i=e.match(/\//)||r&&e.match(/\\/)?[``]:[...r?[process.cwd()]:[],...(t.path||{}.PATH||``).split(n)],o=r?t.pathExt||{}.PATHEXT||`.EXE;.CMD;.BAT;.COM`:``,s=r?o.split(n):[``];return r&&e.indexOf(`.`)!==-1&&s[0]!==``&&s.unshift(``),{pathEnv:i,pathExt:s,pathExtExe:o}},l=(e,t,n)=>{typeof t==`function`&&(n=t,t={}),t||={};let{pathEnv:r,pathExt:a,pathExtExe:l}=c(e,t),u=[],d=n=>new Promise((a,o)=>{if(n===r.length)return t.all&&u.length?a(u):o(s(e));let c=r[n],l=/^".*"$/.test(c)?c.slice(1,-1):c,d=i.join(l,e);a(f(!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d,n,0))}),f=(e,n,r)=>new Promise((i,s)=>{if(r===a.length)return i(d(n+1));let c=a[r];o(e+c,{pathExt:l},(a,o)=>{if(!a&&o)if(t.all)u.push(e+c);else return i(e+c);return i(f(e,n,r+1))})});return n?d(0).then(e=>n(null,e),n):d(0)};n.exports=l,l.sync=(e,t)=>{t||={};let{pathEnv:n,pathExt:r,pathExtExe:a}=c(e,t),l=[];for(let s=0;s<n.length;s++){let c=n[s],u=/^".*"$/.test(c)?c.slice(1,-1):c,d=i.join(u,e),f=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d;for(let e=0;e<r.length;e++){let n=f+r[e];try{if(o.sync(n,{pathExt:a}))if(t.all)l.push(n);else return n}catch{}}}if(t.all&&l.length)return l;if(t.nothrow)return null;throw s(e)}})),A=i(((e,t)=>{var n=(e={})=>{let t=e.env||{};return(e.platform||`browser`)===`win32`?Object.keys(t).reverse().find(e=>e.toUpperCase()===`PATH`)||`Path`:`PATH`};t.exports=n,t.exports.default=n})),j=i(((t,n)=>{var r=(m(),e(p)),i=k(),a=A();function o(e,t){let n=e.options.env||{},o=process.cwd(),s=e.options.cwd!=null,c=s&&process.chdir!==void 0&&!process.chdir.disabled;if(c)try{process.chdir(e.options.cwd)}catch{}let l;try{l=i.sync(e.command,{path:n[a({env:n})],pathExt:t?r.delimiter:void 0})}catch{}finally{c&&process.chdir(o)}return l&&=r.resolve(s?e.options.cwd:``,l),l}function s(e){return o(e)||o(e,!0)}n.exports=s})),M=i(((e,t)=>{var n=/([()\][%!^"`<>&|;, *?])/g;function r(e){return e=e.replace(n,`^$1`),e}function i(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,`$1$1\\"`),e=e.replace(/(?=(\\+?)?)\1$/,`$1$1`),e=`"${e}"`,e=e.replace(n,`^$1`),t&&(e=e.replace(n,`^$1`)),e}t.exports.command=r,t.exports.argument=i})),N=i(((e,t)=>{t.exports=/^#!(.*)/})),P=i(((e,t)=>{var n=N();t.exports=(e=``)=>{let t=e.match(n);if(!t)return null;let[r,i]=t[0].replace(/#! ?/,``).split(` `),a=r.split(`/`).pop();return a===`env`?i:i?`${a} ${i}`:a}})),F=i(((t,n)=>{var r=(f(),e(d)),i=P();function a(e){let t=Buffer.alloc(150),n;try{n=r.openSync(e,`r`),r.readSync(n,t,0,150,0),r.closeSync(n)}catch{}return i(t.toString())}n.exports=a})),I=i(((e,t)=>{m(),j(),M(),F();function n(e){return e}function r(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null),t=t?t.slice(0):[],r=Object.assign({},r);let i={command:e,args:t,options:r,file:void 0,original:{command:e,args:t}};return r.shell?i:n(i)}t.exports=r})),L=i(((e,t)=>{function n(e,t){return Object.assign(Error(`${t} ${e.command} ENOENT`),{code:`ENOENT`,errno:`ENOENT`,syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function r(e,t){}function i(e,t){return null}function a(e,t){return null}t.exports={hookChildProcess:r,verifyENOENT:i,verifyENOENTSync:a,notFoundError:n}})),R=n(i(((t,n)=>{var r=(T(),e(g)),i=I(),a=L();function o(e,t,n){let o=i(e,t,n),s=r.spawn(o.command,o.args,o.options);return a.hookChildProcess(s,o),s}function s(e,t,n){let o=i(e,t,n),s=r.spawnSync(o.command,o.args,o.options);return s.error=s.error||a.verifyENOENTSync(s.status,o),s}n.exports=o,n.exports.spawn=o,n.exports.sync=s,n.exports._parse=i,n.exports._enoent=a}))(),1),z=class{constructor(){console.warn(`PassThrough stream is not available in browser environment`)}},B=class{append(e){this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(`
|
|
2
2
|
`);if(e===-1)return null;let t=this._buffer.toString(`utf8`,0,e).replace(/\r$/,``);return this._buffer=this._buffer.subarray(e+1),V(t)}clear(){this._buffer=void 0}};function V(e){return s.parse(JSON.parse(e))}function H(e){return JSON.stringify(e)+`
|
|
3
3
|
`}var U=h.platform===`win32`?[`APPDATA`,`HOMEDRIVE`,`HOMEPATH`,`LOCALAPPDATA`,`PATH`,`PROCESSOR_ARCHITECTURE`,`SYSTEMDRIVE`,`SYSTEMROOT`,`TEMP`,`USERNAME`,`USERPROFILE`,`PROGRAMFILES`]:[`HOME`,`LOGNAME`,`PATH`,`SHELL`,`TERM`,`USER`];function W(){let e={};for(let t of U){let n=h.env[t];n!==void 0&&(n.startsWith(`()`)||(e[t]=n))}return e}var G=class{constructor(e){this._readBuffer=new B,this._stderrStream=null,this._serverParams=e,(e.stderr===`pipe`||e.stderr===`overlapped`)&&(this._stderrStream=new z)}async start(){if(this._process)throw Error(`StdioClientTransport already started! If using Client class, note that connect() calls start() automatically.`);return new Promise((e,t)=>{this._process=(0,R.default)(this._serverParams.command,this._serverParams.args??[],{env:{...W(),...this._serverParams.env},stdio:[`pipe`,`pipe`,this._serverParams.stderr??`inherit`],shell:!1,windowsHide:h.platform===`win32`&&K(),cwd:this._serverParams.cwd}),this._process.on(`error`,e=>{t(e),this.onerror?.(e)}),this._process.on(`spawn`,()=>{e()}),this._process.on(`close`,e=>{this._process=void 0,this.onclose?.()}),this._process.stdin?.on(`error`,e=>{this.onerror?.(e)}),this._process.stdout?.on(`data`,e=>{this._readBuffer.append(e),this.processReadBuffer()}),this._process.stdout?.on(`error`,e=>{this.onerror?.(e)}),this._stderrStream&&this._process.stderr&&this._process.stderr.pipe(this._stderrStream)})}get stderr(){return this._stderrStream?this._stderrStream:this._process?.stderr??null}get pid(){return this._process?.pid??null}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){if(this._process){let e=this._process;this._process=void 0;let t=new Promise(t=>{e.once(`close`,()=>{t()})});try{e.stdin?.end()}catch{}if(await Promise.race([t,new Promise(e=>setTimeout(e,2e3).unref())]),e.exitCode===null){try{e.kill(`SIGTERM`)}catch{}await Promise.race([t,new Promise(e=>setTimeout(e,2e3).unref())])}if(e.exitCode===null)try{e.kill(`SIGKILL`)}catch{}}this._readBuffer.clear()}send(e){return new Promise(t=>{if(!this._process?.stdin)throw Error(`Not connected`);let n=H(e);this._process.stdin.write(n)?t():this._process.stdin.once(`drain`,t)})}};function K(){return`type`in h}var q=class extends l{static{a(this,`StdioConnectionManager`)}serverParams;errlog;_transport=null;constructor(e,t=process.stderr){super(),this.serverParams=e,this.errlog=t}async establishConnection(){return this._transport=new G(this.serverParams),this._transport.stderr&&typeof this._transport.stderr.pipe==`function`&&this._transport.stderr.pipe(this.errlog),o.debug(`${this.constructor.name} connected successfully`),this._transport}async closeConnection(e){if(this._transport)try{await this._transport.close()}catch(e){o.warn(`Error closing stdio transport: ${e}`)}finally{this._transport=null}}},J=class extends c{static{a(this,`StdioConnector`)}command;args;env;errlog;clientInfo;constructor({command:e=`npx`,args:t=[],env:n,errlog:r=h.stderr,...i}={}){super(i),this.command=e,this.args=t,this.env=n,this.errlog=r,this.clientInfo=i.clientInfo??{name:`stdio-connector`,version:`1.0.0`}}async connect(){if(this.connected){o.debug(`Already connected to MCP implementation`);return}o.debug(`Connecting to MCP implementation via stdio: ${this.command}`);try{let e;if(this.env){e={};for(let[t,n]of Object.entries(h.env))n!==void 0&&(e[t]=n);Object.assign(e,this.env)}this.connectionManager=new q({command:this.command,args:this.args,env:e},this.errlog);let t=await this.connectionManager.start(),n={...this.opts.clientOptions||{},capabilities:{...this.opts.clientOptions?.capabilities||{},roots:{listChanged:!0},...this.opts.onSampling??this.opts.samplingCallback?{sampling:{}}:{},...this.opts.onElicitation??this.opts.elicitationCallback?{elicitation:{form:{},url:{}}}:{}}};this.client=new u(this.clientInfo,n),await this.client.connect(t),this.connected=!0,this.setupNotificationHandler(),this.setupRootsHandler(),this.setupSamplingHandler(),this.setupElicitationHandler(),o.debug(`Successfully connected to MCP implementation: ${this.command}`),this.trackConnectorInit({serverCommand:this.command,serverArgs:this.args,publicIdentifier:`${this.command} ${this.args.join(` `)}`})}catch(e){throw o.error(`Failed to connect to MCP implementation: ${e}`),await this.cleanupResources(),e}}get publicIdentifier(){return{type:`stdio`,"command&args":`${this.command} ${this.args.join(` `)}`}}};export{J as StdioConnector};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{er as e}from"./json-schema-processors-DSIsU0go.js";import{An as t,Ct as n,D as r,Et as i,Fr as a,G as o,H as s,Nn as c,Ot as l,P as u,Rr as d,St as f,T as p,Tt as m,_t as h,cn as g,ln as _,mr as v,q as y,sn as b,xt as x,yt as S}from"./index-
|
|
1
|
+
import{er as e}from"./json-schema-processors-DSIsU0go.js";import{An as t,Ct as n,D as r,Et as i,Fr as a,G as o,H as s,Nn as c,Ot as l,P as u,Rr as d,St as f,T as p,Tt as m,_t as h,cn as g,ln as _,mr as v,q as y,sn as b,xt as x,yt as S}from"./index-zqVFP8t5.js";import{a as C,i as w,l as T,o as E,r as D}from"./function_calling-XyGNNvjR.js";var O={};v(O,{BaseToolkit:()=>N,DynamicStructuredTool:()=>M,DynamicTool:()=>j,StructuredTool:()=>k,Tool:()=>A,ToolInputParsingException:()=>b,isLangChainTool:()=>D,isRunnableToolLike:()=>w,isStructuredTool:()=>C,isStructuredToolParams:()=>E,tool:()=>P});var k=class extends T{extras;returnDirect=!1;verboseParsingErrors=!1;get lc_namespace(){return[`langchain`,`tools`]}responseFormat=`content`;defaultConfig;constructor(e){super(e??{}),this.verboseParsingErrors=e?.verboseParsingErrors??this.verboseParsingErrors,this.responseFormat=e?.responseFormat??this.responseFormat,this.defaultConfig=e?.defaultConfig??this.defaultConfig,this.metadata=e?.metadata??this.metadata,this.extras=e?.extras??this.extras}async invoke(e,t){let n,r=S(x(this.defaultConfig,t));return _(e)?(n=e.args,r={...r,toolCall:e}):n=e,this.call(n,r)}async call(t,n,a){let c=_(t)?t.args:t,d;if(o(this.schema))try{d=await u(this.schema,c)}catch(n){let r=`Received tool input did not match expected schema`;throw this.verboseParsingErrors&&(r=`${r}\nDetails: ${n.message}`),s(n)&&(r=`${r}\n\n${e(n)}`),new b(r,JSON.stringify(t))}else{let e=r(c,this.schema);if(!e.valid){let n=`Received tool input did not match expected schema`;throw this.verboseParsingErrors&&(n=`${n}\nDetails: ${e.errors.map(e=>`${e.keywordLocation}: ${e.error}`).join(`
|
|
2
2
|
`)}`),new b(n,JSON.stringify(t))}d=c}let f=l(n),p=await i.configure(f.callbacks,this.callbacks,f.tags||a,this.tags,f.metadata,this.metadata,{verbose:this.verbose})?.handleToolStart(this.toJSON(),typeof t==`string`?t:JSON.stringify(t),f.runId,void 0,void 0,void 0,f.runName);delete f.runId;let m;try{m=await this._call(d,p,f)}catch(e){throw await p?.handleToolError(e),e}let h,v;if(this.responseFormat===`content_and_artifact`)if(Array.isArray(m)&&m.length===2)[h,v]=m;else throw Error(`Tool response format is "content_and_artifact" but the output was not a two-tuple.\nResult: ${JSON.stringify(m)}`);else h=m;let y;_(t)&&(y=t.id),!y&&g(f)&&(y=f.toolCall.id);let x=F({content:h,artifact:v,toolCallId:y,name:this.name,metadata:this.metadata});return await p?.handleToolEnd(x),x}},A=class extends k{schema=a({input:d().optional()}).transform(e=>e.input);constructor(e){super(e)}call(e,t){let n=typeof e==`string`||e==null?{input:e}:e;return super.call(n,t)}},j=class extends A{static lc_name(){return`DynamicTool`}name;description;func;constructor(e){super(e),this.name=e.name,this.description=e.description,this.func=e.func,this.returnDirect=e.returnDirect??this.returnDirect}async call(e,t){let n=l(t);return n.runName===void 0&&(n.runName=this.name),super.call(e,n)}async _call(e,t,n){return this.func(e,t,n)}},M=class extends k{static lc_name(){return`DynamicStructuredTool`}description;func;schema;constructor(e){super(e),this.name=e.name,this.description=e.description,this.func=e.func,this.returnDirect=e.returnDirect??this.returnDirect,this.schema=e.schema}async call(e,t,n){let r=l(t);return r.runName===void 0&&(r.runName=this.name),super.call(e,r,n)}_call(e,t,n){return this.func(e,t,n)}},N=class{getTools(){return this.tools}};function P(e,t){let r=y(t.schema),i=p(t.schema);if(!t.schema||r||i)return new j({...t,description:t.description??t.schema?.description??`${t.name} tool`,func:async(t,r,i)=>new Promise((a,o)=>{let s=f(i,{callbacks:r?.getChild()});m.runWithConfig(n(s),async()=>{try{a(e(t,s))}catch(e){o(e)}})})});let a=t.schema,o=t.description??t.schema.description??`${t.name} tool`;return new M({...t,description:o,schema:a,func:async(t,r,i)=>new Promise((a,o)=>{let s,c=()=>{i?.signal&&s&&i.signal.removeEventListener(`abort`,s)};i?.signal&&(s=()=>{c(),o(h(i.signal))},i.signal.addEventListener(`abort`,s));let l=f(i,{callbacks:r?.getChild()});m.runWithConfig(n(l),async()=>{try{let n=await e(t,l);if(i?.signal?.aborted){c();return}c(),a(n)}catch(e){c(),o(e)}})})})}function F(e){let{content:n,artifact:r,toolCallId:i,metadata:a}=e;return i&&!c(n)?typeof n==`string`||Array.isArray(n)&&n.every(e=>typeof e==`object`)?new t({status:`success`,content:n,artifact:r,tool_call_id:i,name:e.name,metadata:a}):new t({status:`success`,content:I(n),artifact:r,tool_call_id:i,name:e.name,metadata:a}):n}function I(e){try{return JSON.stringify(e)??``}catch{return`${e}`}}export{P as a,A as i,j as n,O as o,k as r,M as t};
|
package/dist/web/index.html
CHANGED
|
@@ -27,17 +27,17 @@
|
|
|
27
27
|
rel="stylesheet"
|
|
28
28
|
/>
|
|
29
29
|
<title>Inspector | mcp-use</title>
|
|
30
|
-
<script type="module" crossorigin src="/inspector/assets/index-
|
|
30
|
+
<script type="module" crossorigin src="/inspector/assets/index-zqVFP8t5.js"></script>
|
|
31
31
|
<link rel="modulepreload" crossorigin href="/inspector/assets/chunk-zsgVPwQN.js">
|
|
32
32
|
<link rel="modulepreload" crossorigin href="/inspector/assets/preload-helper-XLr9-hSf.js">
|
|
33
33
|
<link rel="modulepreload" crossorigin href="/inspector/assets/json-schema-processors-DSIsU0go.js">
|
|
34
34
|
<link rel="modulepreload" crossorigin href="/inspector/assets/schemas-79owEkeD.js">
|
|
35
35
|
<link rel="modulepreload" crossorigin href="/inspector/assets/chunk-3GQAWCBQ-C-9Cm0Np.js">
|
|
36
36
|
<link rel="modulepreload" crossorigin href="/inspector/assets/chunk-QWQYAQCK-CyFuZlX8.js">
|
|
37
|
-
<link rel="modulepreload" crossorigin href="/inspector/assets/client-
|
|
38
|
-
<link rel="modulepreload" crossorigin href="/inspector/assets/chunk-
|
|
37
|
+
<link rel="modulepreload" crossorigin href="/inspector/assets/client-DEFMLVFC.js">
|
|
38
|
+
<link rel="modulepreload" crossorigin href="/inspector/assets/chunk-6E445R5C-ny1rw8Le.js">
|
|
39
39
|
<link rel="stylesheet" crossorigin href="/inspector/assets/index-DAB6h2wg.css">
|
|
40
|
-
<script>window.__INSPECTOR_VERSION__ = "0.26.
|
|
40
|
+
<script>window.__INSPECTOR_VERSION__ = "0.26.1";</script>
|
|
41
41
|
</head>
|
|
42
42
|
<body>
|
|
43
43
|
<script>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mcp-use/inspector",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.26.
|
|
4
|
+
"version": "0.26.1",
|
|
5
5
|
"description": "MCP Inspector - A tool for inspecting and debugging MCP servers",
|
|
6
6
|
"author": "",
|
|
7
7
|
"license": "MIT",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"express": "^4.21.2 || ^5.0.0",
|
|
46
|
-
"mcp-use": ">=1.22.
|
|
46
|
+
"mcp-use": ">=1.22.3",
|
|
47
47
|
"react": "^18.0.0 || ^19.0.0",
|
|
48
48
|
"react-dom": "^18.0.0 || ^19.0.0",
|
|
49
49
|
"react-router": "^7.12.0"
|
|
@@ -91,7 +91,8 @@
|
|
|
91
91
|
"sonner": "^2.0.7",
|
|
92
92
|
"tailwind-merge": "^3.5.0",
|
|
93
93
|
"vite-express": "^0.22.0",
|
|
94
|
-
"zod": "4.3.5"
|
|
94
|
+
"zod": "4.3.5",
|
|
95
|
+
"mcp-use": "1.22.3"
|
|
95
96
|
},
|
|
96
97
|
"publishConfig": {
|
|
97
98
|
"access": "public"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{pn as e,tn as t,vn as n}from"./index-DnLjyl1f.js";export{t as AIMessage,n as HumanMessage,e as SystemMessage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{hr as e}from"./index-DnLjyl1f.js";export default e();
|