@loop_ouroboros/mcp-hub-lite 1.0.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.
Files changed (37) hide show
  1. package/README.md +15 -0
  2. package/dist/client/assets/{HomeView-f901HeKw.js → HomeView-Cr1jX73N.js} +1 -1
  3. package/dist/client/assets/{ResourceDetailView-Bz66ZjfY.js → ResourceDetailView-BQ49hk0c.js} +1 -1
  4. package/dist/client/assets/{ResourcesView-lI_fItfA.js → ResourcesView-BYZfWtia.js} +1 -1
  5. package/dist/client/assets/{ServerDashboard-Bgx8WVkx.js → ServerDashboard-DHcxwKeh.js} +1 -1
  6. package/dist/client/assets/{ServerListView-CP6Ffkfx.js → ServerListView-DralUL71.js} +1 -1
  7. package/dist/client/assets/{SessionsView-D68qKR4D.js → SessionsView-BCGRTqem.js} +1 -1
  8. package/dist/client/assets/{SettingsView-BPYfO9BE.js → SettingsView-BLfxa6PZ.js} +1 -1
  9. package/dist/client/assets/ToolCallDialog-BhdPX-Kf.css +1 -0
  10. package/dist/client/assets/ToolCallDialog-DQ0OQ1mD.js +1 -0
  11. package/dist/client/assets/ToolsView-BLB6x3tC.js +1 -0
  12. package/dist/client/assets/ToolsView-E3Ps9c7i.css +1 -0
  13. package/dist/client/assets/{_baseClone-DCmK847M.js → _baseClone-Bo5mBgsT.js} +1 -1
  14. package/dist/client/assets/{el-form-item-DM0q2hmO.js → el-form-item-BmeJKVSi.js} +1 -1
  15. package/dist/client/assets/{el-input-BtI9NECe.js → el-input-CeZiq23m.js} +1 -1
  16. package/dist/client/assets/{el-loading-CChNmKeI.js → el-loading-Csv24uBk.js} +1 -1
  17. package/dist/client/assets/{el-overlay-lZZbPmsX.js → el-overlay-iw_hrrlC.js} +1 -1
  18. package/dist/client/assets/{el-select-BXztu2b5.js → el-select-B73uRP_Y.js} +1 -1
  19. package/dist/client/assets/{el-tab-pane-Dy9ruaEX.js → el-tab-pane-BgOTBn4X.js} +1 -1
  20. package/dist/client/assets/{el-table-column-98UyVgBH.js → el-table-column-Ld4GSD3x.js} +1 -1
  21. package/dist/client/assets/{el-tag-B5lLT51E.js → el-tag-DYmSo8Bx.js} +1 -1
  22. package/dist/client/assets/{index-BzQXG7no.js → index-COYaYRbH.js} +1 -1
  23. package/dist/client/assets/{index-CSTs2jYk.js → index-Cfcvxyee.js} +2 -2
  24. package/dist/client/assets/{index-BgKcmWJr.js → index-PhuI36Zi.js} +1 -1
  25. package/dist/client/assets/{omit-Bx5HJNV_.js → omit-7EL6VJO4.js} +1 -1
  26. package/dist/client/assets/{raf-B9VDMtMF.js → raf-DDfJOMYh.js} +1 -1
  27. package/dist/client/assets/{vnode-B8aJx8u4.js → vnode-upjuIlvm.js} +1 -1
  28. package/dist/client/index.html +1 -1
  29. package/dist/server/src/api/web/hub-tools.d.ts.map +1 -1
  30. package/dist/server/src/api/web/hub-tools.js +4 -1
  31. package/dist/server/src/services/gateway/request-handlers/system-tools-handler.d.ts.map +1 -1
  32. package/dist/server/src/services/gateway/request-handlers/system-tools-handler.js +16 -4
  33. package/package.json +1 -1
  34. package/dist/client/assets/ToolCallDialog-Br8FNebN.js +0 -1
  35. package/dist/client/assets/ToolCallDialog-C7eh7jHE.css +0 -1
  36. package/dist/client/assets/ToolsView-B6hUiR43.js +0 -1
  37. package/dist/client/assets/ToolsView-BLnU8cV6.css +0 -1
@@ -1 +1 @@
1
- import{t as w,c as N,A as u,x as V,y as i,C as p,U as y,v,J as o,u as s,I as h,O as r,G as m,K as _,M as I}from"./vue-vendor-6ny5zj9i.js";import{F as $,b3 as F,_ as G,aG as J,W as K,I as P,b2 as C,a as S,J as A}from"./index-CSTs2jYk.js";const L=$({type:{type:String,values:["primary","success","info","warning","danger"],default:"primary"},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:String,size:{type:String,values:F},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),O={close:t=>t instanceof MouseEvent,click:t=>t instanceof MouseEvent},U=["aria-label"],W=["aria-label"],j=w({name:"ElTag",__name:"tag",props:L,emits:O,setup(t,{emit:B}){const E=t,d=B,T=J(),{t:b}=K(),a=P("tag"),f=N(()=>{const{type:e,hit:n,effect:l,closable:c,round:M}=E;return[a.b(),a.is("closable",c),a.m(e||"primary"),a.m(T.value),a.m(l),a.is("hit",n),a.is("round",M)]}),g=e=>{d("close",e)},k=e=>{d("click",e)},z=e=>{var n,l,c;(c=(l=(n=e?.component)==null?void 0:n.subTree)==null?void 0:l.component)!=null&&c.bum&&(e.component.subTree.component.bum=null)};return(e,n)=>e.disableTransitions?(i(),u("span",{key:0,class:o(f.value),style:_({backgroundColor:e.color}),onClick:k},[p("span",{class:o(s(a).e("content"))},[v(e.$slots,"default")],2),e.closable?(i(),u("button",{key:0,"aria-label":s(b)("el.tag.close"),class:o(s(a).e("close")),type:"button",onClick:h(g,["stop"])},[r(s(S),null,{default:m(()=>[r(s(C))]),_:1})],10,U)):y("v-if",!0)],6)):(i(),V(I,{key:1,name:`${s(a).namespace.value}-zoom-in-center`,appear:"",onVnodeMounted:z},{default:m(()=>[p("span",{class:o(f.value),style:_({backgroundColor:e.color}),onClick:k},[p("span",{class:o(s(a).e("content"))},[v(e.$slots,"default")],2),e.closable?(i(),u("button",{key:0,"aria-label":s(b)("el.tag.close"),class:o(s(a).e("close")),type:"button",onClick:h(g,["stop"])},[r(s(S),null,{default:m(()=>[r(s(C))]),_:1})],10,W)):y("v-if",!0)],6)]),_:3},8,["name"]))}});var q=G(j,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tag/src/tag.vue"]]);const Q=A(q);export{Q as E,L as t};
1
+ import{t as w,c as N,A as u,x as V,y as i,C as p,U as y,v,J as o,u as s,I as h,O as r,G as m,K as _,M as I}from"./vue-vendor-6ny5zj9i.js";import{F as $,b3 as F,_ as G,aG as J,W as K,I as P,b2 as C,a as S,J as A}from"./index-Cfcvxyee.js";const L=$({type:{type:String,values:["primary","success","info","warning","danger"],default:"primary"},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:String,size:{type:String,values:F},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),O={close:t=>t instanceof MouseEvent,click:t=>t instanceof MouseEvent},U=["aria-label"],W=["aria-label"],j=w({name:"ElTag",__name:"tag",props:L,emits:O,setup(t,{emit:B}){const E=t,d=B,T=J(),{t:b}=K(),a=P("tag"),f=N(()=>{const{type:e,hit:n,effect:l,closable:c,round:M}=E;return[a.b(),a.is("closable",c),a.m(e||"primary"),a.m(T.value),a.m(l),a.is("hit",n),a.is("round",M)]}),g=e=>{d("close",e)},k=e=>{d("click",e)},z=e=>{var n,l,c;(c=(l=(n=e?.component)==null?void 0:n.subTree)==null?void 0:l.component)!=null&&c.bum&&(e.component.subTree.component.bum=null)};return(e,n)=>e.disableTransitions?(i(),u("span",{key:0,class:o(f.value),style:_({backgroundColor:e.color}),onClick:k},[p("span",{class:o(s(a).e("content"))},[v(e.$slots,"default")],2),e.closable?(i(),u("button",{key:0,"aria-label":s(b)("el.tag.close"),class:o(s(a).e("close")),type:"button",onClick:h(g,["stop"])},[r(s(S),null,{default:m(()=>[r(s(C))]),_:1})],10,U)):y("v-if",!0)],6)):(i(),V(I,{key:1,name:`${s(a).namespace.value}-zoom-in-center`,appear:"",onVnodeMounted:z},{default:m(()=>[p("span",{class:o(f.value),style:_({backgroundColor:e.color}),onClick:k},[p("span",{class:o(s(a).e("content"))},[v(e.$slots,"default")],2),e.closable?(i(),u("button",{key:0,"aria-label":s(b)("el.tag.close"),class:o(s(a).e("close")),type:"button",onClick:h(g,["stop"])},[r(s(S),null,{default:m(()=>[r(s(C))]),_:1})],10,W)):y("v-if",!0)],6)]),_:3},8,["name"]))}});var q=G(j,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tag/src/tag.vue"]]);const Q=A(q);export{Q as E,L as t};
@@ -1 +1 @@
1
- import{ap as a,bt as c,bs as s,bu as u,bq as g,bv as v,aw as O}from"./index-CSTs2jYk.js";import{g as b,c as p,f as y,e as _}from"./_baseClone-DCmK847M.js";var P="[object Object]",L=Function.prototype,m=Object.prototype,f=L.toString,w=m.hasOwnProperty,C=f.call(Object);function A(t){if(!a(t)||c(t)!=P)return!1;var r=b(t);if(r===null)return!0;var e=w.call(r,"constructor")&&r.constructor;return typeof e=="function"&&e instanceof e&&f.call(e)==C}function S(t,r,e){var o=-1,n=t.length;r<0&&(r=-r>n?0:n+r),e=e>n?n:e,e<0&&(e+=n),n=r>e?0:e-r>>>0,r>>>=0;for(var i=Array(n);++o<n;)i[o]=t[o+r];return i}function j(t){var r=t==null?0:t.length;return r?t[r-1]:void 0}function E(t,r){return r.length<2?t:s(t,S(r,0,-1))}var F=Object.prototype,G=F.hasOwnProperty;function h(t,r){r=u(r,t);var e=-1,o=r.length;if(!o)return!0;for(var n=t==null||typeof t!="object"&&typeof t!="function";++e<o;){var i=r[e];if(typeof i=="string"){if(i==="__proto__"&&!G.call(t,"__proto__"))return!1;if(i==="constructor"&&e+1<o&&typeof r[e+1]=="string"&&r[e+1]==="prototype"){if(n&&e===0)continue;return!1}}}var l=E(t,r);return l==null||delete l[g(j(r))]}function T(t){return A(t)?void 0:t}var x=1,N=2,D=4,R=v(function(t,r){var e={};if(t==null)return e;var o=!1;r=O(r,function(i){return i=u(i,t),o||(o=i.length>1),i}),p(t,y(t),e),o&&(e=_(e,x|N|D,T));for(var n=r.length;n--;)h(e,r[n]);return e});export{A as i,R as o};
1
+ import{ap as a,bt as c,bs as s,bu as u,bq as g,bv as v,aw as O}from"./index-Cfcvxyee.js";import{g as b,c as p,f as y,e as _}from"./_baseClone-Bo5mBgsT.js";var P="[object Object]",L=Function.prototype,m=Object.prototype,f=L.toString,w=m.hasOwnProperty,C=f.call(Object);function A(t){if(!a(t)||c(t)!=P)return!1;var r=b(t);if(r===null)return!0;var e=w.call(r,"constructor")&&r.constructor;return typeof e=="function"&&e instanceof e&&f.call(e)==C}function S(t,r,e){var o=-1,n=t.length;r<0&&(r=-r>n?0:n+r),e=e>n?n:e,e<0&&(e+=n),n=r>e?0:e-r>>>0,r>>>=0;for(var i=Array(n);++o<n;)i[o]=t[o+r];return i}function j(t){var r=t==null?0:t.length;return r?t[r-1]:void 0}function E(t,r){return r.length<2?t:s(t,S(r,0,-1))}var F=Object.prototype,G=F.hasOwnProperty;function h(t,r){r=u(r,t);var e=-1,o=r.length;if(!o)return!0;for(var n=t==null||typeof t!="object"&&typeof t!="function";++e<o;){var i=r[e];if(typeof i=="string"){if(i==="__proto__"&&!G.call(t,"__proto__"))return!1;if(i==="constructor"&&e+1<o&&typeof r[e+1]=="string"&&r[e+1]==="prototype"){if(n&&e===0)continue;return!1}}}var l=E(t,r);return l==null||delete l[g(j(r))]}function T(t){return A(t)?void 0:t}var x=1,N=2,D=4,R=v(function(t,r){var e={};if(t==null)return e;var o=!1;r=O(r,function(i){return i=u(i,t),o||(o=i.length>1),i}),p(t,y(t),e),o&&(e=_(e,x|N|D,T));for(var n=r.length;n--;)h(e,r[n]);return e});export{A as i,R as o};
@@ -1 +1 @@
1
- import{i as o}from"./index-CSTs2jYk.js";const e=i=>o?window.requestAnimationFrame(i):setTimeout(i,16),r=i=>o?window.cancelAnimationFrame(i):clearTimeout(i);export{r as c,e as r};
1
+ import{i as o}from"./index-Cfcvxyee.js";const e=i=>o?window.requestAnimationFrame(i):setTimeout(i,16),r=i=>o?window.cancelAnimationFrame(i):clearTimeout(i);export{r as c,e as r};
@@ -1 +1 @@
1
- import{i as u}from"./index-CSTs2jYk.js";import{b as f,ai as T}from"./vue-vendor-6ny5zj9i.js";let i;const m=e=>{var s;if(!u)return 0;if(i!==void 0)return i;const t=document.createElement("div");t.className=`${e}-scrollbar__wrap`,t.style.visibility="hidden",t.style.width="100px",t.style.position="absolute",t.style.top="-9999px",document.body.appendChild(t);const o=t.offsetWidth;t.style.overflow="scroll";const r=document.createElement("div");r.style.width="100%",t.appendChild(r);const n=r.offsetWidth;return(s=t.parentNode)==null||s.removeChild(t),i=o-n,i};function v(e,s){if(!u)return;if(!s){e.scrollTop=0;return}const t=[];let o=s.offsetParent;for(;o!==null&&e!==o&&e.contains(o);)t.push(o),o=o.offsetParent;const r=s.offsetTop+t.reduce((A,N)=>A+N.offsetTop,0),n=r+s.offsetHeight,p=e.scrollTop,S=p+e.clientHeight;r<p?e.scrollTop=r:n>S&&(e.scrollTop=n-e.clientHeight)}var l=(e=>(e[e.TEXT=1]="TEXT",e[e.CLASS=2]="CLASS",e[e.STYLE=4]="STYLE",e[e.PROPS=8]="PROPS",e[e.FULL_PROPS=16]="FULL_PROPS",e[e.HYDRATE_EVENTS=32]="HYDRATE_EVENTS",e[e.STABLE_FRAGMENT=64]="STABLE_FRAGMENT",e[e.KEYED_FRAGMENT=128]="KEYED_FRAGMENT",e[e.UNKEYED_FRAGMENT=256]="UNKEYED_FRAGMENT",e[e.NEED_PATCH=512]="NEED_PATCH",e[e.DYNAMIC_SLOTS=1024]="DYNAMIC_SLOTS",e[e.HOISTED=-1]="HOISTED",e[e.BAIL=-2]="BAIL",e))(l||{});const E=e=>{const s=f(e)?e:[e],t=[];return s.forEach(o=>{var r;f(o)?t.push(...E(o)):T(o)&&((r=o.component)!=null&&r.subTree)?t.push(o,...E(o.component.subTree)):T(o)&&f(o.children)?t.push(...E(o.children)):T(o)&&o.shapeFlag===2?t.push(...E(o.type())):t.push(o)}),t};export{l as P,E as f,m as g,v as s};
1
+ import{i as u}from"./index-Cfcvxyee.js";import{b as f,ai as T}from"./vue-vendor-6ny5zj9i.js";let i;const m=e=>{var s;if(!u)return 0;if(i!==void 0)return i;const t=document.createElement("div");t.className=`${e}-scrollbar__wrap`,t.style.visibility="hidden",t.style.width="100px",t.style.position="absolute",t.style.top="-9999px",document.body.appendChild(t);const o=t.offsetWidth;t.style.overflow="scroll";const r=document.createElement("div");r.style.width="100%",t.appendChild(r);const n=r.offsetWidth;return(s=t.parentNode)==null||s.removeChild(t),i=o-n,i};function v(e,s){if(!u)return;if(!s){e.scrollTop=0;return}const t=[];let o=s.offsetParent;for(;o!==null&&e!==o&&e.contains(o);)t.push(o),o=o.offsetParent;const r=s.offsetTop+t.reduce((A,N)=>A+N.offsetTop,0),n=r+s.offsetHeight,p=e.scrollTop,S=p+e.clientHeight;r<p?e.scrollTop=r:n>S&&(e.scrollTop=n-e.clientHeight)}var l=(e=>(e[e.TEXT=1]="TEXT",e[e.CLASS=2]="CLASS",e[e.STYLE=4]="STYLE",e[e.PROPS=8]="PROPS",e[e.FULL_PROPS=16]="FULL_PROPS",e[e.HYDRATE_EVENTS=32]="HYDRATE_EVENTS",e[e.STABLE_FRAGMENT=64]="STABLE_FRAGMENT",e[e.KEYED_FRAGMENT=128]="KEYED_FRAGMENT",e[e.UNKEYED_FRAGMENT=256]="UNKEYED_FRAGMENT",e[e.NEED_PATCH=512]="NEED_PATCH",e[e.DYNAMIC_SLOTS=1024]="DYNAMIC_SLOTS",e[e.HOISTED=-1]="HOISTED",e[e.BAIL=-2]="BAIL",e))(l||{});const E=e=>{const s=f(e)?e:[e],t=[];return s.forEach(o=>{var r;f(o)?t.push(...E(o)):T(o)&&((r=o.component)!=null&&r.subTree)?t.push(o,...E(o.component.subTree)):T(o)&&f(o.children)?t.push(...E(o.children)):T(o)&&o.shapeFlag===2?t.push(...E(o.type())):t.push(o)}),t};export{l as P,E as f,m as g,v as s};
@@ -5,7 +5,7 @@
5
5
  <link rel="icon" href="/favicon.ico" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>MCP Server Manager</title>
8
- <script type="module" crossorigin src="/assets/index-CSTs2jYk.js"></script>
8
+ <script type="module" crossorigin src="/assets/index-Cfcvxyee.js"></script>
9
9
  <link rel="modulepreload" crossorigin href="/assets/vue-vendor-6ny5zj9i.js">
10
10
  <link rel="stylesheet" crossorigin href="/assets/index-BsDWtoIl.css">
11
11
  </head>
@@ -1 +1 @@
1
- {"version":3,"file":"hub-tools.d.ts","sourceRoot":"","sources":["../../../../../src/api/web/hub-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AA8B1C;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,eAAe,iBA0O/D"}
1
+ {"version":3,"file":"hub-tools.d.ts","sourceRoot":"","sources":["../../../../../src/api/web/hub-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AA8B1C;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,eAAe,iBA6O/D"}
@@ -154,7 +154,10 @@ export async function webHubToolsRoutes(fastify) {
154
154
  toolArgs: z.record(z.string(), z.any()),
155
155
  requestOptions: z
156
156
  .object({
157
- sessionId: z.string().optional(),
157
+ sessionId: z
158
+ .union([z.string(), z.null()])
159
+ .optional()
160
+ .transform((val) => val ?? undefined),
158
161
  tags: z.record(z.string(), z.string()).optional()
159
162
  })
160
163
  .optional()
@@ -1 +1 @@
1
- {"version":3,"file":"system-tools-handler.d.ts","sourceRoot":"","sources":["../../../../../../src/services/gateway/request-handlers/system-tools-handler.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAczE;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAgOnE"}
1
+ {"version":3,"file":"system-tools-handler.d.ts","sourceRoot":"","sources":["../../../../../../src/services/gateway/request-handlers/system-tools-handler.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAczE;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA4OnE"}
@@ -46,7 +46,10 @@ export function registerSystemToolsHandlers(server) {
46
46
  serverName: z.string(),
47
47
  requestOptions: z
48
48
  .object({
49
- sessionId: z.string().optional(),
49
+ sessionId: z
50
+ .union([z.string(), z.null()])
51
+ .optional()
52
+ .transform((val) => val ?? undefined),
50
53
  tags: z.record(z.string(), z.string()).optional()
51
54
  })
52
55
  .optional()
@@ -80,7 +83,10 @@ export function registerSystemToolsHandlers(server) {
80
83
  caseSensitive: z.boolean().optional().default(false),
81
84
  requestOptions: z
82
85
  .object({
83
- sessionId: z.string().optional(),
86
+ sessionId: z
87
+ .union([z.string(), z.null()])
88
+ .optional()
89
+ .transform((val) => val ?? undefined),
84
90
  tags: z.record(z.string(), z.string()).optional()
85
91
  })
86
92
  .optional()
@@ -112,7 +118,10 @@ export function registerSystemToolsHandlers(server) {
112
118
  toolName: z.string(),
113
119
  requestOptions: z
114
120
  .object({
115
- sessionId: z.string().optional(),
121
+ sessionId: z
122
+ .union([z.string(), z.null()])
123
+ .optional()
124
+ .transform((val) => val ?? undefined),
116
125
  tags: z.record(z.string(), z.string()).optional()
117
126
  })
118
127
  .optional()
@@ -150,7 +159,10 @@ export function registerSystemToolsHandlers(server) {
150
159
  toolArgs: z.record(z.string(), z.unknown()),
151
160
  requestOptions: z
152
161
  .object({
153
- sessionId: z.string().optional(),
162
+ sessionId: z
163
+ .union([z.string(), z.null()])
164
+ .optional()
165
+ .transform((val) => val ?? undefined),
154
166
  tags: z.record(z.string(), z.string()).optional()
155
167
  })
156
168
  .optional()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loop_ouroboros/mcp-hub-lite",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "A lightweight MCP management platform designed for independent developers",
5
5
  "license": "MIT",
6
6
  "author": "loop_ouroboros",
@@ -1 +0,0 @@
1
- import{c as H,O as V,S as M}from"./index-CSTs2jYk.js";import{e as P}from"./el-overlay-lZZbPmsX.js";import{E as R}from"./el-input-BtI9NECe.js";import"./el-tag-B5lLT51E.js";import{a as K,E as Q}from"./el-select-BXztu2b5.js";import{t as W,a6 as X,c as E,r as g,w as $,x as I,u as o,G as v,C as s,A as m,U as k,$ as r,O as _,P as Y,ak as Z,a9 as w,y as i}from"./vue-vendor-6ny5zj9i.js";import{E as C}from"./index-BzQXG7no.js";import{_ as ee}from"./_plugin-vue_export-helper-DlAUqK2U.js";const te={class:"flex flex-col h-[60vh]"},le={key:0,class:"mb-4 text-gray-600 dark:text-gray-400 bg-gray-50 dark:bg-gray-800/50 p-3 rounded-lg border border-gray-100 dark:border-gray-700/50 max-h-32 overflow-y-auto"},ae={key:1,class:"mb-4 flex items-center"},oe={class:"font-medium text-gray-700 dark:text-gray-300 mr-2 whitespace-nowrap"},se={class:"flex-1 flex gap-4 min-h-0"},re={class:"flex-1 flex flex-col min-w-0"},ne={class:"flex justify-between items-center mb-2"},ie={class:"font-medium text-gray-700 dark:text-gray-300"},ce={class:"flex-1 flex flex-col min-w-0 border-l border-gray-200 dark:border-gray-700 pl-4"},ue={class:"flex justify-between items-center mb-2"},de={class:"font-medium text-gray-700 dark:text-gray-300"},me={class:"flex-1 overflow-auto bg-gray-50 dark:bg-[#0f172a] rounded-lg border border-gray-200 dark:border-gray-700 p-4 font-mono text-sm"},pe={key:0,class:"whitespace-pre-wrap break-words text-gray-600 dark:text-gray-400"},fe={key:1,class:"whitespace-pre-wrap break-words text-green-600 dark:text-green-400"},ge={key:2,class:"whitespace-pre-wrap break-words text-red-600 dark:text-red-400"},ve={key:3,class:"whitespace-pre-wrap break-words text-gray-600 dark:text-gray-400"},ye={class:"flex justify-between items-center"},he={class:"text-xs text-gray-500"},xe={key:0},_e={class:"flex gap-2"},be=W({__name:"ToolCallDialog",props:{modelValue:{type:Boolean},serverName:{},toolName:{},description:{},inputSchema:{}},emits:["update:modelValue"],setup(y,{emit:j}){const{t:l}=X(),n=y,A=j,S=E({get:()=>n.modelValue,set:e=>A("update:modelValue",e)}),h=g("{}"),p=g(null),c=g(null),b=g(!1),f=g(!1),N=g([]),x=g(null),J=E(()=>n.inputSchema?JSON.stringify(n.inputSchema,null,2):"{}"),O=async()=>{if(n.serverName)try{const e=await V.get(`/web/server-instances/${n.serverName}`),t=Array.isArray(e)?e:[];N.value=t,t.length>0&&(x.value=t[0].id)}catch(e){console.error("Failed to fetch server instances:",e),N.value=[],x.value=null}};$(()=>n.serverName,()=>{O()}),$(()=>n.modelValue,e=>{if(e){const t=B(n.inputSchema);h.value=JSON.stringify(t,null,2),p.value=null,c.value=null,O()}},{immediate:!0});function B(e){if(!e||!e.properties)return{};const t={};for(const[d,D]of Object.entries(e.properties)){const a=D;a.default!==void 0?t[d]=a.default:a.type==="string"?t[d]="":a.type==="number"||a.type==="integer"?t[d]=0:a.type==="boolean"?t[d]=!1:a.type==="array"?t[d]=[]:a.type==="object"?t[d]={}:t[d]=null}return t}function T(){try{const e=JSON.parse(h.value);h.value=JSON.stringify(e,null,2)}catch{C.warning(l("toolCallDialog.invalidJson"))}}function z(){f.value=!f.value}function F(e){return`${e.id}`}function U(){console.log("Selected instance:",x.value)}async function L(){try{let e;try{e=JSON.parse(h.value)}catch{C.error(l("toolCallDialog.invalidJsonArguments"));return}b.value=!0,p.value=null,c.value=null,f.value=!1;let t;n.serverName?t=await V.post(`/web/hub-tools/servers/${n.serverName}/tools/${n.toolName}/call`,{toolArgs:e,requestOptions:{sessionId:x.value}}):t=await V.post(`/web/hub-tools/system/${n.toolName}/call`,{toolArgs:e}),p.value=JSON.stringify(t,null,2),C.success(l("toolCallDialog.executionSuccessful"))}catch(e){console.error("Tool execution failed:",e),e instanceof Error?c.value=e.message||String(e):c.value=String(e),e instanceof M&&e.data?c.value=typeof e.data=="string"?e.data:JSON.stringify(e.data,null,2):typeof e=="object"&&e!==null&&"response"in e&&e.response?.data&&(c.value=JSON.stringify(e.response.data,null,2)),C.error(l("toolCallDialog.executionFailed"))}finally{b.value=!1}}return(e,t)=>{const d=K,D=Q,a=H,q=R,G=P;return i(),I(G,{modelValue:S.value,"onUpdate:modelValue":t[3]||(t[3]=u=>S.value=u),title:o(l)("toolCallDialog.title",{toolName:y.toolName}),width:"800px",class:"tool-call-dialog","destroy-on-close":""},{footer:v(()=>[s("div",ye,[s("div",he,[b.value?(i(),m("span",xe,r(o(l)("toolCallDialog.executing")),1)):k("",!0)]),s("div",_e,[_(a,{onClick:t[2]||(t[2]=u=>S.value=!1)},{default:v(()=>[w(r(o(l)("action.cancel")),1)]),_:1}),_(a,{type:"primary",loading:b.value,onClick:L},{default:v(()=>[w(r(o(l)("toolCallDialog.execute")),1)]),_:1},8,["loading"])])])]),default:v(()=>[s("div",te,[y.description?(i(),m("div",le,r(y.description),1)):k("",!0),y.serverName&&y.serverName!=="system"?(i(),m("div",ae,[s("span",oe,r(o(l)("toolCallDialog.instance")),1),_(D,{modelValue:x.value,"onUpdate:modelValue":t[0]||(t[0]=u=>x.value=u),placeholder:o(l)("toolCallDialog.selectInstance"),size:"small",class:"flex-1",onChange:U},{default:v(()=>[(i(!0),m(Y,null,Z(N.value,u=>(i(),I(d,{key:u.id,label:F(u),value:u.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])):k("",!0),s("div",se,[s("div",re,[s("div",ne,[s("span",ie,r(o(l)("toolCallDialog.arguments")),1),_(a,{link:"",type:"primary",size:"small",onClick:T},{default:v(()=>[w(r(o(l)("toolCallDialog.formatJson")),1)]),_:1})]),_(q,{modelValue:h.value,"onUpdate:modelValue":t[1]||(t[1]=u=>h.value=u),type:"textarea",class:"flex-1 font-mono custom-textarea","input-style":{height:"100%",fontFamily:"monospace"},placeholder:'{"key": "value"}',resize:"none",maxlength:"1000000","show-word-limit":""},null,8,["modelValue"])]),s("div",ce,[s("div",ue,[s("span",de,r(f.value?o(l)("toolCallDialog.inputSchema"):p.value||c.value?o(l)("toolCallDialog.response"):o(l)("toolCallDialog.inputSchema")),1),p.value||c.value||f.value?(i(),I(a,{key:0,link:"",type:"info",size:"small",onClick:z},{default:v(()=>[w(r(f.value?o(l)("toolCallDialog.showResponse"):o(l)("toolCallDialog.showInputSchema")),1)]),_:1})):k("",!0)]),s("div",me,[f.value?(i(),m("pre",pe,r(J.value),1)):p.value?(i(),m("pre",fe,r(p.value),1)):c.value?(i(),m("pre",ge,r(c.value),1)):(i(),m("pre",ve,r(J.value),1))])])])])]),_:1},8,["modelValue","title"])}}}),Je=ee(be,[["__scopeId","data-v-1693fd2c"]]);export{Je as T};
@@ -1 +0,0 @@
1
- .custom-textarea[data-v-1693fd2c] .el-textarea__inner{height:100%}
@@ -1 +0,0 @@
1
- import{u as G,N as H,a as J,O as U,c as M,P as K,Q as z,y as W,R as X}from"./index-CSTs2jYk.js";import{c as Y}from"./el-overlay-lZZbPmsX.js";import{E as Z}from"./el-input-BtI9NECe.js";import{t as j,A as i,C as t,U as L,J as E,$ as r,y as a,a6 as ee,r as u,c as te,f as se,x as T,O as l,G as x,u as g,H as F,a9 as O,L as P,P as S,ak as V}from"./vue-vendor-6ny5zj9i.js";import{T as oe}from"./ToolCallDialog-Br8FNebN.js";import{_ as ae}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./vnode-B8aJx8u4.js";import"./event-BB_Ol6Sd.js";import"./typescript-Bp3YSIOJ.js";import"./el-tag-B5lLT51E.js";import"./el-select-BXztu2b5.js";import"./index-BgKcmWJr.js";import"./index-BzQXG7no.js";const le={class:"min-w-0 mb-3"},re={class:"flex items-center gap-2 mb-2"},ne=["title"],ie=["title"],R=j({__name:"ToolCard",props:{title:{},description:{},tagName:{},tagClass:{}},emits:["call"],setup(c){return(f,p)=>(a(),i("div",{class:"bg-white dark:bg-[#1e293b] border border-gray-200 dark:border-gray-700 rounded-lg p-4 flex flex-col justify-between shadow-sm hover:shadow-md transition-shadow h-full cursor-pointer",onClick:p[0]||(p[0]=_=>f.$emit("call"))},[t("div",le,[t("div",re,[c.tagName?(a(),i("span",{key:0,class:E(["shrink-0 px-2 py-0.5 rounded-full text-xs font-medium whitespace-nowrap",c.tagClass||"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300"])},r(c.tagName),3)):L("",!0),t("span",{class:"font-bold text-gray-900 dark:text-gray-100 font-mono text-base break-all",title:c.title},r(c.title),9,ne)]),t("p",{class:"text-sm text-gray-600 dark:text-gray-400 line-clamp-2",title:c.description},r(c.description||f.$t("tools.noDescription")),9,ie)])]))}}),ce={class:"tools-view py-6 px-4 sm:px-6 lg:px-8 max-w-7xl mx-auto w-full h-full flex flex-col overflow-hidden bg-gray-50 dark:bg-[#0f172a] transition-colors duration-300"},de={class:"mb-6 shrink-0"},me={class:"text-2xl font-semibold text-gray-900 dark:text-white mb-4"},ue={class:"relative"},pe={class:"flex-1 overflow-y-auto custom-scrollbar space-y-8 pr-2"},ve={class:"text-lg font-bold text-gray-900 dark:text-white"},ge={class:"text-sm font-normal text-gray-500 ml-2"},fe={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mb-8 transition-all duration-300"},he={class:"flex items-center gap-2 mb-4"},ye={class:"text-lg font-bold text-gray-900 dark:text-white"},xe={class:"text-sm font-normal text-gray-500 ml-2"},_e={key:0,class:"space-y-4"},ke={key:1,class:"text-center py-8 text-gray-500"},be={key:2,class:"space-y-6"},we=["onClick"],Ce={class:"text-xs bg-gray-100 dark:bg-gray-800 px-2 py-0.5 rounded-full"},$e={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 transition-all duration-300"},Ne=j({__name:"ToolsView",setup(c){const{t:f}=ee(),p=u(""),_=u(!1),D=u([]),b=G(),w=u([]),C=u(!1),v=u(null),h=u(new Set),k=u(!1);function Q(e){h.value.has(e)?h.value.delete(e):h.value.add(e)}async function q(){try{const e=await U.get("/web/hub-tools/system");w.value=e.map(s=>({...s,serverName:"system"})).sort((s,d)=>s.name.localeCompare(d.name))}catch(e){console.error("Failed to fetch system tools:",e)}}function I(e){v.value={...e,serverName:e.serverName},C.value=!0}async function B(){_.value=!0;try{const e=await U.get(`/web/search?q=${encodeURIComponent(p.value)}`);D.value=e.results||[]}catch(e){console.error("Failed to fetch tools:",e)}finally{_.value=!1}}function A(){B()}const $=te(()=>{const e={};return D.value.forEach(s=>{const y=b.servers.find(N=>N.name===s.tool.serverName)?.status==="online"?f("tools.online"):f("tools.offline"),n=s.tool.serverName?`${s.tool.serverName} (${y})`:"Unknown";e[n]||(e[n]=[]),e[n].push(s)}),Object.entries(e).map(([s,d])=>({serverName:s,tools:d.sort((y,n)=>y.tool.name.localeCompare(n.tool.name))})).sort((s,d)=>s.serverName.localeCompare(d.serverName))});return se(()=>{q(),B(),b.servers.length===0&&b.fetchServers()}),(e,s)=>{const d=M,y=Z,n=J,N=Y;return a(),i("div",ce,[t("div",de,[t("h2",me,r(e.$t("tools.title")),1),t("div",ue,[l(y,{modelValue:p.value,"onUpdate:modelValue":s[0]||(s[0]=o=>p.value=o),placeholder:e.$t("tools.searchPlaceholder"),class:"w-full",size:"large","prefix-icon":g(H),onInput:A},{append:x(()=>[l(d,{icon:g(K)},null,8,["icon"])]),_:1},8,["modelValue","placeholder","prefix-icon"])])]),t("div",pe,[t("section",null,[t("div",{class:"flex items-center gap-2 mb-4 cursor-pointer select-none hover:text-gray-700 dark:hover:text-gray-200 transition-colors",onClick:s[1]||(s[1]=o=>k.value=!k.value)},[l(n,{class:E(["transition-transform duration-200",{"-rotate-90":k.value}])},{default:x(()=>[l(g(z))]),_:1},8,["class"]),l(n,{class:"text-gray-900 dark:text-white",size:20},{default:x(()=>[l(g(W))]),_:1}),t("h3",ve,[O(r(e.$t("tools.systemTools"))+" ",1),t("span",ge,"("+r(w.value.length)+")",1)])]),F(t("div",fe,[(a(!0),i(S,null,V(w.value,o=>(a(),T(R,{key:o.name,title:o.name,description:o.description,"tag-name":e.$t("tools.systemTag"),"tag-class":"bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300",onCall:m=>I(o)},null,8,["title","description","tag-name","onCall"]))),128))],512),[[P,!k.value]])]),t("section",null,[t("div",he,[l(n,{class:"text-gray-900 dark:text-white",size:20},{default:x(()=>[l(g(X))]),_:1}),t("h3",ye,[O(r(e.$t("tools.aggregatedTools"))+" ",1),t("span",xe,"("+r($.value.reduce((o,m)=>o+m.tools.length,0))+")",1)])]),_.value?(a(),i("div",_e,[l(N,{animated:"",count:3})])):$.value.length===0?(a(),i("div",ke,r(e.$t("tools.noToolsFound")),1)):(a(),i("div",be,[(a(!0),i(S,null,V($.value,o=>(a(),i("div",{key:o.serverName,class:"space-y-3"},[t("div",{class:"flex items-center gap-2 text-sm font-medium text-gray-500 dark:text-gray-400 px-1 cursor-pointer select-none hover:text-gray-700 dark:hover:text-gray-200 transition-colors",onClick:m=>Q(o.serverName)},[l(n,{class:E(["transition-transform duration-200",{"-rotate-90":h.value.has(o.serverName)}])},{default:x(()=>[l(g(z))]),_:1},8,["class"]),t("span",null,r(o.serverName),1),t("span",Ce,r(o.tools.length),1)],8,we),F(t("div",$e,[(a(!0),i(S,null,V(o.tools,m=>(a(),T(R,{key:m.tool.name,title:m.tool.name,description:m.tool.description,onCall:Te=>I(m.tool)},null,8,["title","description","onCall"]))),128))],512),[[P,!h.value.has(o.serverName)]])]))),128))]))])]),v.value?(a(),T(oe,{key:0,modelValue:C.value,"onUpdate:modelValue":s[2]||(s[2]=o=>C.value=o),"server-name":v.value.serverName,"tool-name":v.value.name,description:v.value.description,"input-schema":v.value.inputSchema},null,8,["modelValue","server-name","tool-name","description","input-schema"])):L("",!0)])}}}),Le=ae(Ne,[["__scopeId","data-v-7cfeb79a"]]);export{Le as default};
@@ -1 +0,0 @@
1
- .custom-scrollbar[data-v-7cfeb79a]::-webkit-scrollbar{width:6px}.custom-scrollbar[data-v-7cfeb79a]::-webkit-scrollbar-track{background:transparent}.custom-scrollbar[data-v-7cfeb79a]::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:3px}.dark .custom-scrollbar[data-v-7cfeb79a]::-webkit-scrollbar-thumb{background:#475569}