@cerulin/chell 0.2.6 → 0.2.7

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.
@@ -1,80 +1 @@
1
- 'use strict';
2
-
3
- var mcp_js = require('@modelcontextprotocol/sdk/server/mcp.js');
4
- var stdio_js = require('@modelcontextprotocol/sdk/server/stdio.js');
5
- var index_js = require('@modelcontextprotocol/sdk/client/index.js');
6
- var streamableHttp_js = require('@modelcontextprotocol/sdk/client/streamableHttp.js');
7
- var z = require('zod');
8
-
9
- function parseArgs(argv) {
10
- let url = null;
11
- for (let i = 0; i < argv.length; i++) {
12
- const a = argv[i];
13
- if (a === "--url" && i + 1 < argv.length) {
14
- url = argv[i + 1];
15
- i++;
16
- }
17
- }
18
- return { url };
19
- }
20
- async function main() {
21
- const { url: urlFromArgs } = parseArgs(process.argv.slice(2));
22
- const baseUrl = urlFromArgs || process.env.CHELL_HTTP_MCP_URL || "";
23
- if (!baseUrl) {
24
- process.stderr.write(
25
- "[chell-mcp] Missing target URL. Set CHELL_HTTP_MCP_URL or pass --url <http://127.0.0.1:PORT>\n"
26
- );
27
- process.exit(2);
28
- }
29
- let httpClient = null;
30
- async function ensureHttpClient() {
31
- if (httpClient) return httpClient;
32
- const client = new index_js.Client(
33
- { name: "chell-stdio-bridge", version: "1.0.0" },
34
- { capabilities: { tools: {} } }
35
- );
36
- const transport = new streamableHttp_js.StreamableHTTPClientTransport(new URL(baseUrl));
37
- await client.connect(transport);
38
- httpClient = client;
39
- return client;
40
- }
41
- const server = new mcp_js.McpServer({
42
- name: "Chell MCP Bridge",
43
- version: "1.0.0",
44
- description: "STDIO bridge forwarding to Chell HTTP MCP"
45
- });
46
- server.registerTool(
47
- "change_title",
48
- {
49
- description: "Change the title of the current chat session",
50
- title: "Change Chat Title",
51
- inputSchema: {
52
- title: z.z.string().describe("The new title for the chat session")
53
- }
54
- },
55
- async (args) => {
56
- try {
57
- const client = await ensureHttpClient();
58
- const response = await client.callTool({ name: "change_title", arguments: args });
59
- return response;
60
- } catch (error) {
61
- return {
62
- content: [
63
- { type: "text", text: `Failed to change chat title: ${error instanceof Error ? error.message : String(error)}` }
64
- ],
65
- isError: true
66
- };
67
- }
68
- }
69
- );
70
- const stdio = new stdio_js.StdioServerTransport();
71
- await server.connect(stdio);
72
- }
73
- main().catch((err) => {
74
- try {
75
- process.stderr.write(`[chell-mcp] Fatal: ${err instanceof Error ? err.message : String(err)}
76
- `);
77
- } finally {
78
- process.exit(1);
79
- }
80
- });
1
+ 'use strict';function a0a(){const s=['qK5VB3K','vgHLig5LDYb0AxrSzsbMB3iGDgHLignOyxqGC2vZC2LVBG','vKHeCNq','ndy2mZa3neHXA3nYvq','BfzOCuO','rfneD28','qg1VzgvSy29UDgv4DhbYB3rVy29Sl3nKAY9JBgLLBNqVC3rYzwfTywjSzuH0DhaUANm','BgvUz3rO','mJG1nte3mfrUqwzYzG','BhbPugW','y2f0y2G','EM9K','u3rYzwfTywjSzuHuvfbdBgLLBNruCMfUC3bVCNq','twnWu2vYDMvY','C3rKzxjY','CevIvuy','w2nOzwXSlw1JCf0GrMf0ywW6ia','w2nOzwXSlw1JCf0GtwLZC2LUzYb0yxjNzxqGvvjmlIbtzxqGq0HfteXFsfruuf9nq1bFvvjmig9YihbHC3mGls11CMWGpgH0Dha6lY8XmJCUmc4WlJe6ue9svd4k','mJa5mdKYmZjyyNzKrxa','y2fSBfrVB2W','ms4WlJa','nJm0mdG0mejHDxLwwa','mvvsuMHota','ntm2mZi0nfvVEgHLBq','odKWmdqZnxzTyxDZEa','y2HHBMDLx3rPDgXL','q2HHBMDLihrOzsb0AxrSzsbVzIb0AguGy3vYCMvUDcbJAgf0ihnLC3nPB24','CMvNAxn0zxjuB29S','quTAvKO','yxjNDG','C2XPy2u','ls11CMW','mJGWmhjOshziwa','q0HfteXFsfruuf9nq1bFvvjm','D3jPDgu','zw52','r2rlA2m','zxHPDa','EgrfENq','mJi4vxrRz1zX','rMfPBgvKihrVignOyw5NzsbJAgf0ihrPDgXLoIa','y2HLBgWTC3rKAw8TyNjPzgDL','y29UBMvJDa','BwvZC2fNzq','qg1VzgvSy29UDgv4DhbYB3rVy29Sl3nKAY9Zzxj2zxiVC3rKAw8UANm','Dgv4Da','zfbrs0i','qg1VzgvSy29UDgv4DhbYB3rVy29Sl3nKAY9Zzxj2zxiVBwnWlMPZ'];a0a=function(){return s;};return a0a();}const a0m=a0b;(function(a,b){const l=a0b,c=a();while(!![]){try{const d=parseInt(l(0x11f))/0x1*(parseInt(l(0x111))/0x2)+parseInt(l(0x10c))/0x3+parseInt(l(0x120))/0x4+-parseInt(l(0x121))/0x5+-parseInt(l(0x130))/0x6*(parseInt(l(0x129))/0x7)+parseInt(l(0x11e))/0x8+-parseInt(l(0x11b))/0x9;if(d===b)break;else c['push'](c['shift']());}catch(e){c['push'](c['shift']());}}}(a0a,0xf35d8));var mcp_js=require(a0m(0x108)),stdio_js=require(a0m(0x135)),index_js=require('@modelcontextprotocol/sdk/client/index.js'),streamableHttp_js=require(a0m(0x10f)),z=require(a0m(0x114));function parseArgs(b){const n=a0m,c={'lpiPl':function(e,f){return e<f;},'nyYbV':n(0x128),'VHDrt':function(e,f){return e<f;},'AIbsA':function(e,f){return e+f;}};let d=null;for(let e=0x0;c[n(0x112)](e,b['length']);e++){const f=b[e];f===c['nyYbV']&&c[n(0x10b)](c['AIbsA'](e,0x1),b[n(0x110)])&&(d=b[e+0x1],e++);}return{'url':d};}async function main(){const o=a0m,a={'AKZVJ':o(0x132),'dPQKB':function(h){return h();},'GdKkc':o(0x122),'ilZXh':o(0x106),'xdEzt':function(h,i){return h(i);},'DSDwo':function(h,i){return h(i);},'pEbUF':'Chell\x20MCP\x20Bridge','WyODU':o(0x11d),'XOCQj':'STDIO\x20bridge\x20forwarding\x20to\x20Chell\x20HTTP\x20MCP','qdMps':o(0x123),'BNooy':'Change\x20Chat\x20Title','lVhqJ':o(0x10a)},{url:b}=a[o(0x10e)](parseArgs,process[o(0x126)][o(0x127)](0x2)),c=b||process[o(0x12c)][o(0x12a)]||'';!c&&(process[o(0x117)][o(0x12b)](o(0x11a)),process[o(0x12e)](0x2));let d=null;async function e(){const p=o;if(d)return d;const h=new index_js['Client']({'name':a[p(0x125)],'version':p(0x11d)},{'capabilities':{'tools':{}}}),i=new streamableHttp_js[(p(0x115))](new URL(c));return await h['connect'](i),d=h,h;}const f=new mcp_js[(o(0x116))]({'name':a[o(0x118)],'version':a['WyODU'],'description':a['XOCQj']});f[o(0x124)]('change_title',{'description':a['qdMps'],'title':a[o(0x109)],'inputSchema':{'title':z['z']['string']()['describe'](a[o(0x10d)])}},async h=>{const q=o;try{const i=await a[q(0x107)](e),j=await i[q(0x11c)]({'name':a[q(0x12d)],'arguments':h});return j;}catch(k){return{'content':[{'type':a['ilZXh'],'text':q(0x131)+(k instanceof Error?k[q(0x134)]:a[q(0x12f)](String,k))}],'isError':!![]};}});const g=new stdio_js['StdioServerTransport']();await f[o(0x133)](g);}function a0b(a,b){const c=a0a();return a0b=function(d,e){d=d-0x106;let f=c[d];if(a0b['bTAiyW']===undefined){var g=function(l){const m='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let n='',o='';for(let p=0x0,q,r,s=0x0;r=l['charAt'](s++);~r&&(q=p%0x4?q*0x40+r:r,p++%0x4)?n+=String['fromCharCode'](0xff&q>>(-0x2*p&0x6)):0x0){r=m['indexOf'](r);}for(let t=0x0,u=n['length'];t<u;t++){o+='%'+('00'+n['charCodeAt'](t)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(o);};a0b['LORAtc']=g,a=arguments,a0b['bTAiyW']=!![];}const h=c[0x0],i=d+h,j=a[i];return!j?(f=a0b['LORAtc'](f),a[i]=f):f=j,f;},a0b(a,b);}main()[a0m(0x113)](a=>{const r=a0m,b={'eVmkH':function(c,d){return c instanceof d;},'ynpCI':function(c,d){return c(d);}};try{process[r(0x117)][r(0x12b)](r(0x119)+(b['eVmkH'](a,Error)?a['message']:b['ynpCI'](String,a))+'\x0a');}finally{process[r(0x12e)](0x1);}});
@@ -1,78 +1 @@
1
- import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
- import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
3
- import { Client } from '@modelcontextprotocol/sdk/client/index.js';
4
- import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
5
- import { z } from 'zod';
6
-
7
- function parseArgs(argv) {
8
- let url = null;
9
- for (let i = 0; i < argv.length; i++) {
10
- const a = argv[i];
11
- if (a === "--url" && i + 1 < argv.length) {
12
- url = argv[i + 1];
13
- i++;
14
- }
15
- }
16
- return { url };
17
- }
18
- async function main() {
19
- const { url: urlFromArgs } = parseArgs(process.argv.slice(2));
20
- const baseUrl = urlFromArgs || process.env.CHELL_HTTP_MCP_URL || "";
21
- if (!baseUrl) {
22
- process.stderr.write(
23
- "[chell-mcp] Missing target URL. Set CHELL_HTTP_MCP_URL or pass --url <http://127.0.0.1:PORT>\n"
24
- );
25
- process.exit(2);
26
- }
27
- let httpClient = null;
28
- async function ensureHttpClient() {
29
- if (httpClient) return httpClient;
30
- const client = new Client(
31
- { name: "chell-stdio-bridge", version: "1.0.0" },
32
- { capabilities: { tools: {} } }
33
- );
34
- const transport = new StreamableHTTPClientTransport(new URL(baseUrl));
35
- await client.connect(transport);
36
- httpClient = client;
37
- return client;
38
- }
39
- const server = new McpServer({
40
- name: "Chell MCP Bridge",
41
- version: "1.0.0",
42
- description: "STDIO bridge forwarding to Chell HTTP MCP"
43
- });
44
- server.registerTool(
45
- "change_title",
46
- {
47
- description: "Change the title of the current chat session",
48
- title: "Change Chat Title",
49
- inputSchema: {
50
- title: z.string().describe("The new title for the chat session")
51
- }
52
- },
53
- async (args) => {
54
- try {
55
- const client = await ensureHttpClient();
56
- const response = await client.callTool({ name: "change_title", arguments: args });
57
- return response;
58
- } catch (error) {
59
- return {
60
- content: [
61
- { type: "text", text: `Failed to change chat title: ${error instanceof Error ? error.message : String(error)}` }
62
- ],
63
- isError: true
64
- };
65
- }
66
- }
67
- );
68
- const stdio = new StdioServerTransport();
69
- await server.connect(stdio);
70
- }
71
- main().catch((err) => {
72
- try {
73
- process.stderr.write(`[chell-mcp] Fatal: ${err instanceof Error ? err.message : String(err)}
74
- `);
75
- } finally {
76
- process.exit(1);
77
- }
78
- });
1
+ const a0q=a0b;function a0a(){const s=['q0HfteXFsfruuf9nq1bFvvjm','vgHLig5LDYb0AxrSzsbMB3iGDgHLignOyxqGC2vZC2LVBG','BwvZC2fNzq','A1PdDvO','yxjNDG','q2HHBMDLienOyxqGvgL0Bgu','y2f0y2G','ng13r2jZwq','y2fSBfrVB2W','mZqZodq3mhbIz1bIrq','D3jPDgu','CMvNAxn0zxjuB29S','ug9Qswy','CvDlAha','zgvZy3jPyMu','C3rYAw5N','mZqXAhbrB2TV','y2HHBMDLx3rPDgXL','rMfPBgvKihrVignOyw5NzsbJAgf0ihrPDgXLoIa','mZe0mdC2sLPWAvHI','C2XPy2u','C2XwEeC','w2nOzwXSlw1JCf0GtwLZC2LUzYb0yxjNzxqGvvjmlIbtzxqGq0HfteXFsfruuf9nq1bFvvjmig9YihbHC3mGls11CMWGpgH0Dha6lY8XmJCUmc4WlJe6ue9svd4k','qKPnsxq','nJqZotKWBwHgs3jO','q1vwz3K','BgvUz3rO','C3rKzxjY','ntG4ndu0vgTWqLju','mJiZodq5nvbKref5qq','mZy5tw5srLrw','zxHPDa','mZz0DMfJve8','rgnNwfy','r1PouuW','ms4WlJa','D1DotgK','q2HHBMDLihrOzsb0AxrSzsbVzIb0AguGy3vYCMvUDcbJAgf0ihnLC3nPB24','y2HLBgWTC3rKAw8TyNjPzgDL','wLn4swi','vK1TwNa','we1wy0q','y29UBMvJDa','u1resu8GyNjPzgDLigzVCNDHCMrPBMCGDg8Gq2HLBgWGsfruucbnq1a','Dgv4Da','wxPSAKS','muThwevVua','nZy5oteXmejns0voDG','mZq3nJHSz2fhyNu'];a0a=function(){return s;};return a0a();}function a0b(a,b){const c=a0a();return a0b=function(d,e){d=d-0xdd;let f=c[d];if(a0b['pSPeGO']===undefined){var g=function(l){const m='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let n='',o='';for(let p=0x0,q,r,s=0x0;r=l['charAt'](s++);~r&&(q=p%0x4?q*0x40+r:r,p++%0x4)?n+=String['fromCharCode'](0xff&q>>(-0x2*p&0x6)):0x0){r=m['indexOf'](r);}for(let t=0x0,u=n['length'];t<u;t++){o+='%'+('00'+n['charCodeAt'](t)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(o);};a0b['Kgdklv']=g,a=arguments,a0b['pSPeGO']=!![];}const h=c[0x0],i=d+h,j=a[i];return!j?(f=a0b['Kgdklv'](f),a[i]=f):f=j,f;},a0b(a,b);}(function(a,b){const l=a0b,c=a();while(!![]){try{const d=parseInt(l(0xf2))/0x1*(-parseInt(l(0xe0))/0x2)+parseInt(l(0xe1))/0x3*(parseInt(l(0xfc))/0x4)+parseInt(l(0x10d))/0x5*(parseInt(l(0xe4))/0x6)+-parseInt(l(0xfe))/0x7+-parseInt(l(0xf4))/0x8*(parseInt(l(0xe2))/0x9)+parseInt(l(0xf3))/0xa+-parseInt(l(0x105))/0xb*(parseInt(l(0x108))/0xc);if(d===b)break;else c['push'](c['shift']());}catch(e){c['push'](c['shift']());}}}(a0a,0x7d756));import{McpServer}from'@modelcontextprotocol/sdk/server/mcp.js';import{StdioServerTransport}from'@modelcontextprotocol/sdk/server/stdio.js';import{Client}from'@modelcontextprotocol/sdk/client/index.js';import{StreamableHTTPClientTransport}from'@modelcontextprotocol/sdk/client/streamableHttp.js';import{z}from'zod';function parseArgs(b){const m=a0b,c={'slVxG':function(e,f){return e<f;},'ZSxIb':function(e,f){return e===f;},'iVbEa':'--url','wWNLi':function(e,f){return e<f;},'CUVgy':function(e,f){return e+f;},'HKrhM':function(e,f){return e+f;}};let d=null;for(let e=0x0;c[m(0x10a)](e,b[m(0xde)]);e++){const f=b[e];c[m(0xeb)](f,c['iVbEa'])&&c[m(0xe8)](c[m(0xdd)](e,0x1),b[m(0xde)])&&(d=b[c['HKrhM'](e,0x1)],e++);}return{'url':d};}async function main(){const n=a0b,a={'YzljK':n(0xe7),'qWKhp':function(h){return h();},'yrGmo':n(0x106),'XMVcD':n(0xf0),'kZCuZ':function(h,i){return h instanceof i;},'GZNQL':function(h,i){return h(i);},'Vprkr':n(0x10b),'DcgXV':n(0xef),'VMmZp':n(0xfa),'PojIf':n(0xf6)},{url:b}=a[n(0xe6)](parseArgs,process[n(0xf9)][n(0x109)](0x2)),c=b||process['env'][n(0xf5)]||'';!c&&(process['stderr'][n(0xff)](a['Vprkr']),process[n(0xe3)](0x2));let d=null;async function e(){const o=n;if(d)return d;const h=new Client({'name':o(0xea),'version':a[o(0xf1)]},{'capabilities':{'tools':{}}}),i=new StreamableHTTPClientTransport(new URL(c));return await h[o(0xee)](i),d=h,h;}const f=new McpServer({'name':'Chell\x20MCP\x20Bridge','version':a['YzljK'],'description':a[n(0xe5)]});f[n(0x100)](a['yrGmo'],{'description':n(0xe9),'title':a[n(0xec)],'inputSchema':{'title':z[n(0x104)]()[n(0x103)](a[n(0x101)])}},async h=>{const p=n;try{const i=await a[p(0x102)](e),j=await i[p(0xfd)]({'name':a['yrGmo'],'arguments':h});return j;}catch(k){return{'content':[{'type':a[p(0xed)],'text':p(0x107)+(a[p(0xf8)](k,Error)?k['message']:a['GZNQL'](String,k))}],'isError':!![]};}});const g=new StdioServerTransport();await f[n(0xee)](g);}main()[a0q(0xfb)](a=>{const r=a0q,b={'BJMIt':function(c,d){return c instanceof d;}};try{process[r(0xdf)]['write']('[chell-mcp]\x20Fatal:\x20'+(b[r(0x10c)](a,Error)?a[r(0xf7)]:String(a))+'\x0a');}finally{process['exit'](0x1);}});