@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.
- package/dist/clients/typescript/src/live.d.ts +2 -2
- package/dist/clients/typescript/src/live.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.module.js +1 -1
- package/dist/index.module.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/live.ts +1 -1
|
@@ -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
|
-
}) =>
|
|
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,
|
|
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){
|
|
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
|
package/dist/index.cjs.map
CHANGED
|
@@ -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 =
|
|
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
|
-
}) =>
|
|
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 {};
|
package/dist/index.module.js
CHANGED
|
@@ -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){
|
|
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
|
package/dist/index.module.js.map
CHANGED
|
@@ -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 =
|
|
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){
|
|
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
|
package/dist/index.umd.js.map
CHANGED
|
@@ -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 =
|
|
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
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 =
|
|
5
|
+
export let createLiveConnectionClient = (opts: { endpoint: string }) => ({
|
|
6
6
|
connect: (d: {
|
|
7
7
|
tenantId: string;
|
|
8
8
|
connectionId: string;
|