@metorial-services/shuttle-client 1.0.1 → 1.0.2

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.
@@ -2,7 +2,7 @@ import type { JSONRPCMessage } from '@modelcontextprotocol/sdk/types.js';
2
2
  import type { ConnectionMessage } from '../../../service/src/mcp/utils/messenger';
3
3
  export declare let createLiveConnectionClient: (opts: {
4
4
  endpoint: string;
5
- }) => Promise<{
5
+ }) => {
6
6
  connect: (d: {
7
7
  tenantId: string;
8
8
  connectionId: string;
@@ -13,5 +13,5 @@ export declare let createLiveConnectionClient: (opts: {
13
13
  sendMcpMessage: (msg: JSONRPCMessage) => Promise<void>;
14
14
  close: () => Promise<void>;
15
15
  };
16
- }>;
16
+ };
17
17
  //# sourceMappingURL=live.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"live.d.ts","sourceRoot":"","sources":["../../../../src/live.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAElF,eAAO,IAAI,0BAA0B,GAAU,MAAM;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE;iBAC1D;QACX,QAAQ,EAAE,MAAM,CAAC;QACjB,YAAY,EAAE,MAAM,CAAC;QACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;QACpB,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,iBAAiB,KAAK,IAAI,CAAC;QAC7C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;KACtB;8BAsB+B,cAAc;;;EAa9C,CAAC"}
1
+ {"version":3,"file":"live.d.ts","sourceRoot":"","sources":["../../../../src/live.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAElF,eAAO,IAAI,0BAA0B,GAAI,MAAM;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE;iBACpD;QACX,QAAQ,EAAE,MAAM,CAAC;QACjB,YAAY,EAAE,MAAM,CAAC;QACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;QACpB,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,iBAAiB,KAAK,IAAI,CAAC;QAC7C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;KACtB;8BAsB+B,cAAc;;;CAa9C,CAAC"}
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- var e=require("@lowerdeck/rpc-client"),n=require("@metorial/util-websocket");exports.createLiveConnectionClient=function(e){try{return Promise.resolve({connect:function(t){var r=new n.IsomorphicWs(e.endpoint+"/"+t.tenantId+"/connection/"+t.connectionId+"/live");return r.on("open",function(){null==t.onOpen||t.onOpen()}),r.on("message",function(e){var n=JSON.parse(e);null==t.onMessage||t.onMessage({type:n.type,data:n.data})}),r.on("close",function(){null==t.onClose||t.onClose()}),{sendMcpMessage:function(e){try{return Promise.resolve(r.send(JSON.stringify({type:"mcp.message",data:e}))).then(function(){})}catch(e){return Promise.reject(e)}},close:function(){try{return r.close(),Promise.resolve()}catch(e){return Promise.reject(e)}}}}})}catch(e){return Promise.reject(e)}},exports.createShuttleClient=function(n){return e.createClient(n)};
1
+ var e=require("@lowerdeck/rpc-client"),n=require("@metorial/util-websocket");exports.createLiveConnectionClient=function(e){return{connect:function(t){var o=new n.IsomorphicWs(e.endpoint+"/"+t.tenantId+"/connection/"+t.connectionId+"/live");return o.on("open",function(){null==t.onOpen||t.onOpen()}),o.on("message",function(e){var n=JSON.parse(e);null==t.onMessage||t.onMessage({type:n.type,data:n.data})}),o.on("close",function(){null==t.onClose||t.onClose()}),{sendMcpMessage:function(e){try{return Promise.resolve(o.send(JSON.stringify({type:"mcp.message",data:e}))).then(function(){})}catch(e){return Promise.reject(e)}},close:function(){try{return o.close(),Promise.resolve()}catch(e){return Promise.reject(e)}}}}}},exports.createShuttleClient=function(n){return e.createClient(n)};
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../src/live.ts","../src/controller.ts"],"sourcesContent":["import { IsomorphicWs } from '@metorial/util-websocket';\nimport type { JSONRPCMessage } from '@modelcontextprotocol/sdk/types.js';\nimport type { ConnectionMessage } from '../../../service/src/mcp/utils/messenger';\n\nexport let createLiveConnectionClient = async (opts: { endpoint: string }) => ({\n connect: (d: {\n tenantId: string;\n connectionId: string;\n onOpen?: () => void;\n onMessage?: (msg: ConnectionMessage) => void;\n onClose?: () => void;\n }) => {\n let ws = new IsomorphicWs(\n `${opts.endpoint}/${d.tenantId}/connection/${d.connectionId}/live`\n );\n\n ws.on('open', () => {\n d.onOpen?.();\n });\n\n ws.on('message', (data: string) => {\n let msg: any = JSON.parse(data);\n d.onMessage?.({\n type: msg.type,\n data: msg.data\n });\n });\n\n ws.on('close', () => {\n d.onClose?.();\n });\n\n return {\n sendMcpMessage: async (msg: JSONRPCMessage) => {\n await ws.send(\n JSON.stringify({\n type: 'mcp.message',\n data: msg\n })\n );\n },\n close: async () => {\n ws.close();\n }\n };\n }\n});\n","import { createClient } from '@lowerdeck/rpc-client';\nimport { ClientOpts } from '@lowerdeck/rpc-client/dist/shared/clientBuilder';\nimport type { ShuttleClient } from '../../../service/src/apis/controllers';\n\nexport let createShuttleClient = (o: ClientOpts) => createClient<ShuttleClient>(o);\n"],"names":["opts","Promise","resolve","connect","d","ws","IsomorphicWs","endpoint","tenantId","connectionId","on","onOpen","data","msg","JSON","parse","onMessage","type","onClose","sendMcpMessage","send","stringify","then","e","reject","close","o","createClient"],"mappings":"gHAIqC,SAAUA,GAA0B,IAAA,OAAAC,QAAAC,QAAM,CAC7EC,QAAS,SAACC,GAOR,IAAIC,EAAK,IAAIC,eACRN,EAAKO,aAAYH,EAAEI,SAAQ,eAAeJ,EAAEK,aAAmB,SAmBpE,OAhBAJ,EAAGK,GAAG,OAAQ,WACJ,MAARN,EAAEO,QAAFP,EAAEO,QACJ,GAEAN,EAAGK,GAAG,UAAW,SAACE,GAChB,IAAIC,EAAWC,KAAKC,MAAMH,SAC1BR,EAAEY,WAAFZ,EAAEY,UAAY,CACZC,KAAMJ,EAAII,KACVL,KAAMC,EAAID,MAEd,GAEAP,EAAGK,GAAG,QAAS,WACJ,MAATN,EAAEc,SAAFd,EAAEc,SACJ,GAEO,CACLC,eAAc,SAASN,OAAuBZ,OAAAA,QAAAC,QACtCG,EAAGe,KACPN,KAAKO,UAAU,CACbJ,KAAM,cACNL,KAAMC,MAETS,KAAA,WAAA,EACH,CAAC,MAAAC,GAAAtB,OAAAA,QAAAuB,OAAAD,EAAA,CAAA,EACDE,MAAK,WAAA,IACQ,OAAXpB,EAAGoB,QAAQxB,QAAAC,SACb,CAAC,MAAAqB,GAAAtB,OAAAA,QAAAuB,OAAAD,KAEL,GACD,CAAA,MAAAA,GAAA,OAAAtB,QAAAuB,OAAAD,EAAC,CAAA,8BC1C+B,SAACG,GAAa,OAAKC,EAAAA,aAA4BD,EAAE"}
1
+ {"version":3,"file":"index.cjs","sources":["../src/live.ts","../src/controller.ts"],"sourcesContent":["import { IsomorphicWs } from '@metorial/util-websocket';\nimport type { JSONRPCMessage } from '@modelcontextprotocol/sdk/types.js';\nimport type { ConnectionMessage } from '../../../service/src/mcp/utils/messenger';\n\nexport let createLiveConnectionClient = (opts: { endpoint: string }) => ({\n connect: (d: {\n tenantId: string;\n connectionId: string;\n onOpen?: () => void;\n onMessage?: (msg: ConnectionMessage) => void;\n onClose?: () => void;\n }) => {\n let ws = new IsomorphicWs(\n `${opts.endpoint}/${d.tenantId}/connection/${d.connectionId}/live`\n );\n\n ws.on('open', () => {\n d.onOpen?.();\n });\n\n ws.on('message', (data: string) => {\n let msg: any = JSON.parse(data);\n d.onMessage?.({\n type: msg.type,\n data: msg.data\n });\n });\n\n ws.on('close', () => {\n d.onClose?.();\n });\n\n return {\n sendMcpMessage: async (msg: JSONRPCMessage) => {\n await ws.send(\n JSON.stringify({\n type: 'mcp.message',\n data: msg\n })\n );\n },\n close: async () => {\n ws.close();\n }\n };\n }\n});\n","import { createClient } from '@lowerdeck/rpc-client';\nimport { ClientOpts } from '@lowerdeck/rpc-client/dist/shared/clientBuilder';\nimport type { ShuttleClient } from '../../../service/src/apis/controllers';\n\nexport let createShuttleClient = (o: ClientOpts) => createClient<ShuttleClient>(o);\n"],"names":["opts","connect","d","ws","IsomorphicWs","endpoint","tenantId","connectionId","on","onOpen","data","msg","JSON","parse","onMessage","type","onClose","sendMcpMessage","Promise","resolve","send","stringify","then","e","reject","close","o","createClient"],"mappings":"gHAIwC,SAACA,SAAgC,CACvEC,QAAS,SAACC,GAOR,IAAIC,EAAK,IAAIC,EAAYA,aACpBJ,EAAKK,SAAQ,IAAIH,EAAEI,wBAAuBJ,EAAEK,aAAmB,SAmBpE,OAhBAJ,EAAGK,GAAG,OAAQ,WACJ,MAARN,EAAEO,QAAFP,EAAEO,QACJ,GAEAN,EAAGK,GAAG,UAAW,SAACE,GAChB,IAAIC,EAAWC,KAAKC,MAAMH,GACf,MAAXR,EAAEY,WAAFZ,EAAEY,UAAY,CACZC,KAAMJ,EAAII,KACVL,KAAMC,EAAID,MAEd,GAEAP,EAAGK,GAAG,QAAS,WACJ,MAATN,EAAEc,SAAFd,EAAEc,SACJ,GAEO,CACLC,eAAcA,SAASN,GAAmB,IAAIO,OAAAA,QAAAC,QACtChB,EAAGiB,KACPR,KAAKS,UAAU,CACbN,KAAM,cACNL,KAAMC,MAETW,KACH,WAAA,EAAA,CAAC,MAAAC,GAAA,OAAAL,QAAAM,OAAAD,EAAA,CAAA,EACDE,MAAK,WAAA,IACQ,OAAXtB,EAAGsB,QAAQP,QAAAC,SACb,CAAC,MAAAI,GAAA,OAAAL,QAAAM,OAAAD,KAEL,EACD,8BC1CgC,SAACG,GAAa,OAAKC,EAAAA,aAA4BD,EAAE"}
package/dist/index.d.ts CHANGED
@@ -5234,7 +5234,7 @@ export type ConnectionMessage = {
5234
5234
  };
5235
5235
  export declare let createLiveConnectionClient: (opts: {
5236
5236
  endpoint: string;
5237
- }) => Promise<{
5237
+ }) => {
5238
5238
  connect: (d: {
5239
5239
  tenantId: string;
5240
5240
  connectionId: string;
@@ -5245,6 +5245,6 @@ export declare let createLiveConnectionClient: (opts: {
5245
5245
  sendMcpMessage: (msg: JSONRPCMessage) => Promise<void>;
5246
5246
  close: () => Promise<void>;
5247
5247
  };
5248
- }>;
5248
+ };
5249
5249
 
5250
5250
  export {};
@@ -1,2 +1,2 @@
1
- import{createClient as e}from"@lowerdeck/rpc-client";import{IsomorphicWs as n}from"@metorial/util-websocket";var o=function(n){return e(n)},t=function(e){try{return Promise.resolve({connect:function(o){var t=new n(e.endpoint+"/"+o.tenantId+"/connection/"+o.connectionId+"/live");return t.on("open",function(){null==o.onOpen||o.onOpen()}),t.on("message",function(e){var n=JSON.parse(e);null==o.onMessage||o.onMessage({type:n.type,data:n.data})}),t.on("close",function(){null==o.onClose||o.onClose()}),{sendMcpMessage:function(e){try{return Promise.resolve(t.send(JSON.stringify({type:"mcp.message",data:e}))).then(function(){})}catch(e){return Promise.reject(e)}},close:function(){try{return t.close(),Promise.resolve()}catch(e){return Promise.reject(e)}}}}})}catch(e){return Promise.reject(e)}};export{t as createLiveConnectionClient,o as createShuttleClient};
1
+ import{createClient as e}from"@lowerdeck/rpc-client";import{IsomorphicWs as n}from"@metorial/util-websocket";var o=function(n){return e(n)},t=function(e){return{connect:function(o){var t=new n(e.endpoint+"/"+o.tenantId+"/connection/"+o.connectionId+"/live");return t.on("open",function(){null==o.onOpen||o.onOpen()}),t.on("message",function(e){var n=JSON.parse(e);null==o.onMessage||o.onMessage({type:n.type,data:n.data})}),t.on("close",function(){null==o.onClose||o.onClose()}),{sendMcpMessage:function(e){try{return Promise.resolve(t.send(JSON.stringify({type:"mcp.message",data:e}))).then(function(){})}catch(e){return Promise.reject(e)}},close:function(){try{return t.close(),Promise.resolve()}catch(e){return Promise.reject(e)}}}}}};export{t as createLiveConnectionClient,o as createShuttleClient};
2
2
  //# sourceMappingURL=index.module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.module.js","sources":["../src/controller.ts","../src/live.ts"],"sourcesContent":["import { createClient } from '@lowerdeck/rpc-client';\nimport { ClientOpts } from '@lowerdeck/rpc-client/dist/shared/clientBuilder';\nimport type { ShuttleClient } from '../../../service/src/apis/controllers';\n\nexport let createShuttleClient = (o: ClientOpts) => createClient<ShuttleClient>(o);\n","import { IsomorphicWs } from '@metorial/util-websocket';\nimport type { JSONRPCMessage } from '@modelcontextprotocol/sdk/types.js';\nimport type { ConnectionMessage } from '../../../service/src/mcp/utils/messenger';\n\nexport let createLiveConnectionClient = async (opts: { endpoint: string }) => ({\n connect: (d: {\n tenantId: string;\n connectionId: string;\n onOpen?: () => void;\n onMessage?: (msg: ConnectionMessage) => void;\n onClose?: () => void;\n }) => {\n let ws = new IsomorphicWs(\n `${opts.endpoint}/${d.tenantId}/connection/${d.connectionId}/live`\n );\n\n ws.on('open', () => {\n d.onOpen?.();\n });\n\n ws.on('message', (data: string) => {\n let msg: any = JSON.parse(data);\n d.onMessage?.({\n type: msg.type,\n data: msg.data\n });\n });\n\n ws.on('close', () => {\n d.onClose?.();\n });\n\n return {\n sendMcpMessage: async (msg: JSONRPCMessage) => {\n await ws.send(\n JSON.stringify({\n type: 'mcp.message',\n data: msg\n })\n );\n },\n close: async () => {\n ws.close();\n }\n };\n }\n});\n"],"names":["createShuttleClient","o","createClient","createLiveConnectionClient","opts","Promise","resolve","connect","d","ws","IsomorphicWs","endpoint","tenantId","connectionId","on","onOpen","data","msg","JSON","parse","onMessage","type","onClose","sendMcpMessage","send","stringify","then","e","reject","close"],"mappings":"6GAIW,IAAAA,EAAsB,SAACC,GAAa,OAAKC,EAA4BD,EAAE,ECAvEE,EAA0B,SAAUC,GAA0B,IAAA,OAAAC,QAAAC,QAAM,CAC7EC,QAAS,SAACC,GAOR,IAAIC,EAAK,IAAIC,EACRN,EAAKO,aAAYH,EAAEI,SAAQ,eAAeJ,EAAEK,aAAmB,SAmBpE,OAhBAJ,EAAGK,GAAG,OAAQ,WACJ,MAARN,EAAEO,QAAFP,EAAEO,QACJ,GAEAN,EAAGK,GAAG,UAAW,SAACE,GAChB,IAAIC,EAAWC,KAAKC,MAAMH,SAC1BR,EAAEY,WAAFZ,EAAEY,UAAY,CACZC,KAAMJ,EAAII,KACVL,KAAMC,EAAID,MAEd,GAEAP,EAAGK,GAAG,QAAS,WACJ,MAATN,EAAEc,SAAFd,EAAEc,SACJ,GAEO,CACLC,eAAc,SAASN,OAAuBZ,OAAAA,QAAAC,QACtCG,EAAGe,KACPN,KAAKO,UAAU,CACbJ,KAAM,cACNL,KAAMC,MAETS,KAAA,WAAA,EACH,CAAC,MAAAC,GAAAtB,OAAAA,QAAAuB,OAAAD,EAAA,CAAA,EACDE,MAAK,WAAA,IACQ,OAAXpB,EAAGoB,QAAQxB,QAAAC,SACb,CAAC,MAAAqB,GAAAtB,OAAAA,QAAAuB,OAAAD,KAEL,GACD,CAAA,MAAAA,GAAA,OAAAtB,QAAAuB,OAAAD,EAAC,CAAA"}
1
+ {"version":3,"file":"index.module.js","sources":["../src/controller.ts","../src/live.ts"],"sourcesContent":["import { createClient } from '@lowerdeck/rpc-client';\nimport { ClientOpts } from '@lowerdeck/rpc-client/dist/shared/clientBuilder';\nimport type { ShuttleClient } from '../../../service/src/apis/controllers';\n\nexport let createShuttleClient = (o: ClientOpts) => createClient<ShuttleClient>(o);\n","import { IsomorphicWs } from '@metorial/util-websocket';\nimport type { JSONRPCMessage } from '@modelcontextprotocol/sdk/types.js';\nimport type { ConnectionMessage } from '../../../service/src/mcp/utils/messenger';\n\nexport let createLiveConnectionClient = (opts: { endpoint: string }) => ({\n connect: (d: {\n tenantId: string;\n connectionId: string;\n onOpen?: () => void;\n onMessage?: (msg: ConnectionMessage) => void;\n onClose?: () => void;\n }) => {\n let ws = new IsomorphicWs(\n `${opts.endpoint}/${d.tenantId}/connection/${d.connectionId}/live`\n );\n\n ws.on('open', () => {\n d.onOpen?.();\n });\n\n ws.on('message', (data: string) => {\n let msg: any = JSON.parse(data);\n d.onMessage?.({\n type: msg.type,\n data: msg.data\n });\n });\n\n ws.on('close', () => {\n d.onClose?.();\n });\n\n return {\n sendMcpMessage: async (msg: JSONRPCMessage) => {\n await ws.send(\n JSON.stringify({\n type: 'mcp.message',\n data: msg\n })\n );\n },\n close: async () => {\n ws.close();\n }\n };\n }\n});\n"],"names":["createShuttleClient","o","createClient","createLiveConnectionClient","opts","connect","d","ws","IsomorphicWs","endpoint","tenantId","connectionId","on","onOpen","data","msg","JSON","parse","onMessage","type","onClose","sendMcpMessage","Promise","resolve","send","stringify","then","e","reject","close"],"mappings":"6GAIW,IAAAA,EAAsB,SAACC,GAAa,OAAKC,EAA4BD,EAAE,ECAvEE,EAA6B,SAACC,SAAgC,CACvEC,QAAS,SAACC,GAOR,IAAIC,EAAK,IAAIC,EACRJ,EAAKK,SAAQ,IAAIH,EAAEI,wBAAuBJ,EAAEK,aAAmB,SAmBpE,OAhBAJ,EAAGK,GAAG,OAAQ,WACJ,MAARN,EAAEO,QAAFP,EAAEO,QACJ,GAEAN,EAAGK,GAAG,UAAW,SAACE,GAChB,IAAIC,EAAWC,KAAKC,MAAMH,GACf,MAAXR,EAAEY,WAAFZ,EAAEY,UAAY,CACZC,KAAMJ,EAAII,KACVL,KAAMC,EAAID,MAEd,GAEAP,EAAGK,GAAG,QAAS,WACJ,MAATN,EAAEc,SAAFd,EAAEc,SACJ,GAEO,CACLC,eAAcA,SAASN,GAAmB,IAAIO,OAAAA,QAAAC,QACtChB,EAAGiB,KACPR,KAAKS,UAAU,CACbN,KAAM,cACNL,KAAMC,MAETW,KACH,WAAA,EAAA,CAAC,MAAAC,GAAA,OAAAL,QAAAM,OAAAD,EAAA,CAAA,EACDE,MAAK,WAAA,IACQ,OAAXtB,EAAGsB,QAAQP,QAAAC,SACb,CAAC,MAAAI,GAAA,OAAAL,QAAAM,OAAAD,KAEL,EACD"}
package/dist/index.umd.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@lowerdeck/rpc-client"),require("@metorial/util-websocket")):"function"==typeof define&&define.amd?define(["exports","@lowerdeck/rpc-client","@metorial/util-websocket"],n):n((e||self).shuttleClient={},e.rpcClient,e.utilWebsocket)}(this,function(e,n,t){e.createLiveConnectionClient=function(e){try{return Promise.resolve({connect:function(n){var o=new t.IsomorphicWs(e.endpoint+"/"+n.tenantId+"/connection/"+n.connectionId+"/live");return o.on("open",function(){null==n.onOpen||n.onOpen()}),o.on("message",function(e){var t=JSON.parse(e);null==n.onMessage||n.onMessage({type:t.type,data:t.data})}),o.on("close",function(){null==n.onClose||n.onClose()}),{sendMcpMessage:function(e){try{return Promise.resolve(o.send(JSON.stringify({type:"mcp.message",data:e}))).then(function(){})}catch(e){return Promise.reject(e)}},close:function(){try{return o.close(),Promise.resolve()}catch(e){return Promise.reject(e)}}}}})}catch(e){return Promise.reject(e)}},e.createShuttleClient=function(e){return n.createClient(e)}});
1
+ !function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@lowerdeck/rpc-client"),require("@metorial/util-websocket")):"function"==typeof define&&define.amd?define(["exports","@lowerdeck/rpc-client","@metorial/util-websocket"],n):n((e||self).shuttleClient={},e.rpcClient,e.utilWebsocket)}(this,function(e,n,t){e.createLiveConnectionClient=function(e){return{connect:function(n){var o=new t.IsomorphicWs(e.endpoint+"/"+n.tenantId+"/connection/"+n.connectionId+"/live");return o.on("open",function(){null==n.onOpen||n.onOpen()}),o.on("message",function(e){var t=JSON.parse(e);null==n.onMessage||n.onMessage({type:t.type,data:t.data})}),o.on("close",function(){null==n.onClose||n.onClose()}),{sendMcpMessage:function(e){try{return Promise.resolve(o.send(JSON.stringify({type:"mcp.message",data:e}))).then(function(){})}catch(e){return Promise.reject(e)}},close:function(){try{return o.close(),Promise.resolve()}catch(e){return Promise.reject(e)}}}}}},e.createShuttleClient=function(e){return n.createClient(e)}});
2
2
  //# sourceMappingURL=index.umd.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.umd.js","sources":["../src/live.ts","../src/controller.ts"],"sourcesContent":["import { IsomorphicWs } from '@metorial/util-websocket';\nimport type { JSONRPCMessage } from '@modelcontextprotocol/sdk/types.js';\nimport type { ConnectionMessage } from '../../../service/src/mcp/utils/messenger';\n\nexport let createLiveConnectionClient = async (opts: { endpoint: string }) => ({\n connect: (d: {\n tenantId: string;\n connectionId: string;\n onOpen?: () => void;\n onMessage?: (msg: ConnectionMessage) => void;\n onClose?: () => void;\n }) => {\n let ws = new IsomorphicWs(\n `${opts.endpoint}/${d.tenantId}/connection/${d.connectionId}/live`\n );\n\n ws.on('open', () => {\n d.onOpen?.();\n });\n\n ws.on('message', (data: string) => {\n let msg: any = JSON.parse(data);\n d.onMessage?.({\n type: msg.type,\n data: msg.data\n });\n });\n\n ws.on('close', () => {\n d.onClose?.();\n });\n\n return {\n sendMcpMessage: async (msg: JSONRPCMessage) => {\n await ws.send(\n JSON.stringify({\n type: 'mcp.message',\n data: msg\n })\n );\n },\n close: async () => {\n ws.close();\n }\n };\n }\n});\n","import { createClient } from '@lowerdeck/rpc-client';\nimport { ClientOpts } from '@lowerdeck/rpc-client/dist/shared/clientBuilder';\nimport type { ShuttleClient } from '../../../service/src/apis/controllers';\n\nexport let createShuttleClient = (o: ClientOpts) => createClient<ShuttleClient>(o);\n"],"names":["opts","Promise","resolve","connect","d","ws","IsomorphicWs","endpoint","tenantId","connectionId","on","onOpen","data","msg","JSON","parse","onMessage","type","onClose","sendMcpMessage","send","stringify","then","e","reject","close","o","createClient"],"mappings":"4ZAIqC,SAAUA,GAA0B,IAAA,OAAAC,QAAAC,QAAM,CAC7EC,QAAS,SAACC,GAOR,IAAIC,EAAK,IAAIC,eACRN,EAAKO,aAAYH,EAAEI,SAAQ,eAAeJ,EAAEK,aAAmB,SAmBpE,OAhBAJ,EAAGK,GAAG,OAAQ,WACJ,MAARN,EAAEO,QAAFP,EAAEO,QACJ,GAEAN,EAAGK,GAAG,UAAW,SAACE,GAChB,IAAIC,EAAWC,KAAKC,MAAMH,SAC1BR,EAAEY,WAAFZ,EAAEY,UAAY,CACZC,KAAMJ,EAAII,KACVL,KAAMC,EAAID,MAEd,GAEAP,EAAGK,GAAG,QAAS,WACJ,MAATN,EAAEc,SAAFd,EAAEc,SACJ,GAEO,CACLC,eAAc,SAASN,OAAuBZ,OAAAA,QAAAC,QACtCG,EAAGe,KACPN,KAAKO,UAAU,CACbJ,KAAM,cACNL,KAAMC,MAETS,KAAA,WAAA,EACH,CAAC,MAAAC,GAAAtB,OAAAA,QAAAuB,OAAAD,EAAA,CAAA,EACDE,MAAK,WAAA,IACQ,OAAXpB,EAAGoB,QAAQxB,QAAAC,SACb,CAAC,MAAAqB,GAAAtB,OAAAA,QAAAuB,OAAAD,KAEL,GACD,CAAA,MAAAA,GAAA,OAAAtB,QAAAuB,OAAAD,EAAC,CAAA,wBC1C+B,SAACG,GAAa,OAAKC,EAAAA,aAA4BD,EAAE"}
1
+ {"version":3,"file":"index.umd.js","sources":["../src/live.ts","../src/controller.ts"],"sourcesContent":["import { IsomorphicWs } from '@metorial/util-websocket';\nimport type { JSONRPCMessage } from '@modelcontextprotocol/sdk/types.js';\nimport type { ConnectionMessage } from '../../../service/src/mcp/utils/messenger';\n\nexport let createLiveConnectionClient = (opts: { endpoint: string }) => ({\n connect: (d: {\n tenantId: string;\n connectionId: string;\n onOpen?: () => void;\n onMessage?: (msg: ConnectionMessage) => void;\n onClose?: () => void;\n }) => {\n let ws = new IsomorphicWs(\n `${opts.endpoint}/${d.tenantId}/connection/${d.connectionId}/live`\n );\n\n ws.on('open', () => {\n d.onOpen?.();\n });\n\n ws.on('message', (data: string) => {\n let msg: any = JSON.parse(data);\n d.onMessage?.({\n type: msg.type,\n data: msg.data\n });\n });\n\n ws.on('close', () => {\n d.onClose?.();\n });\n\n return {\n sendMcpMessage: async (msg: JSONRPCMessage) => {\n await ws.send(\n JSON.stringify({\n type: 'mcp.message',\n data: msg\n })\n );\n },\n close: async () => {\n ws.close();\n }\n };\n }\n});\n","import { createClient } from '@lowerdeck/rpc-client';\nimport { ClientOpts } from '@lowerdeck/rpc-client/dist/shared/clientBuilder';\nimport type { ShuttleClient } from '../../../service/src/apis/controllers';\n\nexport let createShuttleClient = (o: ClientOpts) => createClient<ShuttleClient>(o);\n"],"names":["opts","connect","d","ws","IsomorphicWs","endpoint","tenantId","connectionId","on","onOpen","data","msg","JSON","parse","onMessage","type","onClose","sendMcpMessage","Promise","resolve","send","stringify","then","e","reject","close","o","createClient"],"mappings":"4ZAIwC,SAACA,SAAgC,CACvEC,QAAS,SAACC,GAOR,IAAIC,EAAK,IAAIC,EAAYA,aACpBJ,EAAKK,SAAQ,IAAIH,EAAEI,wBAAuBJ,EAAEK,aAAmB,SAmBpE,OAhBAJ,EAAGK,GAAG,OAAQ,WACJ,MAARN,EAAEO,QAAFP,EAAEO,QACJ,GAEAN,EAAGK,GAAG,UAAW,SAACE,GAChB,IAAIC,EAAWC,KAAKC,MAAMH,GACf,MAAXR,EAAEY,WAAFZ,EAAEY,UAAY,CACZC,KAAMJ,EAAII,KACVL,KAAMC,EAAID,MAEd,GAEAP,EAAGK,GAAG,QAAS,WACJ,MAATN,EAAEc,SAAFd,EAAEc,SACJ,GAEO,CACLC,eAAcA,SAASN,GAAmB,IAAIO,OAAAA,QAAAC,QACtChB,EAAGiB,KACPR,KAAKS,UAAU,CACbN,KAAM,cACNL,KAAMC,MAETW,KACH,WAAA,EAAA,CAAC,MAAAC,GAAA,OAAAL,QAAAM,OAAAD,EAAA,CAAA,EACDE,MAAK,WAAA,IACQ,OAAXtB,EAAGsB,QAAQP,QAAAC,SACb,CAAC,MAAAI,GAAA,OAAAL,QAAAM,OAAAD,KAEL,EACD,wBC1CgC,SAACG,GAAa,OAAKC,EAAAA,aAA4BD,EAAE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metorial-services/shuttle-client",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/live.ts CHANGED
@@ -2,7 +2,7 @@ import { IsomorphicWs } from '@metorial/util-websocket';
2
2
  import type { JSONRPCMessage } from '@modelcontextprotocol/sdk/types.js';
3
3
  import type { ConnectionMessage } from '../../../service/src/mcp/utils/messenger';
4
4
 
5
- export let createLiveConnectionClient = async (opts: { endpoint: string }) => ({
5
+ export let createLiveConnectionClient = (opts: { endpoint: string }) => ({
6
6
  connect: (d: {
7
7
  tenantId: string;
8
8
  connectionId: string;