@metorial-services/shuttle-client 1.0.0
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/README.md +21 -0
- package/dist/clients/typescript/src/controller.d.ts +4826 -0
- package/dist/clients/typescript/src/controller.d.ts.map +1 -0
- package/dist/clients/typescript/src/index.d.ts +3 -0
- package/dist/clients/typescript/src/index.d.ts.map +1 -0
- package/dist/clients/typescript/src/live.d.ts +17 -0
- package/dist/clients/typescript/src/live.d.ts.map +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +5100 -0
- package/dist/index.module.js +2 -0
- package/dist/index.module.js.map +1 -0
- package/dist/index.umd.js +2 -0
- package/dist/index.umd.js.map +1 -0
- package/package.json +45 -0
- package/src/controller.ts +5 -0
- package/src/index.ts +2 -0
- package/src/live.ts +47 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../../../src/controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,iDAAiD,CAAC;AAG7E,eAAO,IAAI,mBAAmB,GAAI,GAAG,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAmC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { JSONRPCMessage } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import type { ConnectionMessage } from '../../../service/src/mcp/utils/messenger';
|
|
3
|
+
export declare let createLiveConnectionClient: (opts: {
|
|
4
|
+
endpoint: string;
|
|
5
|
+
}) => Promise<{
|
|
6
|
+
connect: (d: {
|
|
7
|
+
tenantId: string;
|
|
8
|
+
connectionId: string;
|
|
9
|
+
onOpen?: () => void;
|
|
10
|
+
onMessage?: (msg: ConnectionMessage) => void;
|
|
11
|
+
onClose?: () => void;
|
|
12
|
+
}) => {
|
|
13
|
+
sendMcpMessage: (msg: JSONRPCMessage) => Promise<void>;
|
|
14
|
+
close: () => Promise<void>;
|
|
15
|
+
};
|
|
16
|
+
}>;
|
|
17
|
+
//# sourceMappingURL=live.d.ts.map
|
|
@@ -0,0 +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"}
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +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)};
|
|
2
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +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"}
|