@metorial/sdk 1.0.0-rc.1 → 1.0.0-rc.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metorial/sdk",
3
- "version": "1.0.0-rc.1",
3
+ "version": "1.0.0-rc.3",
4
4
  "author": "Tobias Herber",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -25,9 +25,9 @@
25
25
  "dist"
26
26
  ],
27
27
  "dependencies": {
28
- "@metorial/core": "^1.0.0-rc.1",
29
- "@metorial/mcp-session": "^1.0.0-rc.1",
30
- "@metorial/util-endpoint": "^1.0.0-rc.1"
28
+ "@metorial/core": "^1.0.0-rc.3",
29
+ "@metorial/mcp-session": "^1.0.0-rc.3",
30
+ "@metorial/util-endpoint": "^1.0.0-rc.3"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@types/isomorphic-fetch": "^0.0.39",
package/dist/index.cjs DELETED
@@ -1,69 +0,0 @@
1
- 'use strict';
2
-
3
- var core = require('@metorial/core');
4
- var mcpSession = require('@metorial/mcp-session');
5
-
6
- // src/metorial.ts
7
- var Metorial = class {
8
- constructor(init) {
9
- this.sdk = core.createMetorialCoreSDK(init);
10
- }
11
- get instance() {
12
- return this.sdk.instance;
13
- }
14
- get secrets() {
15
- return this.sdk.secrets;
16
- }
17
- get servers() {
18
- return this.sdk.servers;
19
- }
20
- get sessions() {
21
- return this.sdk.sessions;
22
- }
23
- get _config() {
24
- return this.sdk._config;
25
- }
26
- get mcp() {
27
- return {
28
- createSession: (init) => new mcpSession.MetorialMcpSession(this.sdk, init),
29
- withSession: this.withSession.bind(this),
30
- withProviderSession: this.withProviderSession.bind(this),
31
- createConnection: this.createMcpConnection.bind(this)
32
- };
33
- }
34
- async createMcpConnection(init) {
35
- let session = new mcpSession.MetorialMcpSession(this.sdk, {
36
- serverDeployments: [init]
37
- });
38
- let deployments = await session.getServerDeployments();
39
- return await session.getClient({
40
- deploymentId: deployments[0].id
41
- });
42
- }
43
- async withSession(init, action) {
44
- let session = new mcpSession.MetorialMcpSession(this.sdk, init);
45
- try {
46
- return await action(session);
47
- } finally {
48
- await session.close();
49
- }
50
- }
51
- async withProviderSession(provider, init, action) {
52
- return this.withSession(init, async (session) => {
53
- let providerData = await provider(session);
54
- return action({
55
- ...providerData,
56
- session,
57
- getSession: session.getSession.bind(session),
58
- getCapabilities: session.getCapabilities.bind(session),
59
- getClient: session.getClient.bind(session),
60
- getServerDeployments: session.getServerDeployments.bind(session),
61
- getToolManager: session.getToolManager.bind(session)
62
- });
63
- });
64
- }
65
- };
66
-
67
- exports.Metorial = Metorial;
68
- //# sourceMappingURL=out.js.map
69
- //# sourceMappingURL=index.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/metorial.ts"],"names":[],"mappings":";AAAA,SAA0B,6BAA6B;AACvD;AAAA,EACE;AAAA,OAGK;AAEA,IAAM,WAAN,MAA0C;AAAA,EAG/C,YAAY,MAAmD;AAC7D,SAAK,MAAM,sBAAsB,IAAI;AAAA,EACvC;AAAA,EAEA,IAAI,WAAW;AACb,WAAO,KAAK,IAAI;AAAA,EAClB;AAAA,EAEA,IAAI,UAAU;AACZ,WAAO,KAAK,IAAI;AAAA,EAClB;AAAA,EAEA,IAAI,UAAU;AACZ,WAAO,KAAK,IAAI;AAAA,EAClB;AAAA,EAEA,IAAI,WAAW;AACb,WAAO,KAAK,IAAI;AAAA,EAClB;AAAA,EAEA,IAAI,UAAU;AACZ,WAAO,KAAK,IAAI;AAAA,EAClB;AAAA,EAEA,IAAI,MAAM;AACR,WAAO;AAAA,MACL,eAAe,CAAC,SAAiC,IAAI,mBAAmB,KAAK,KAAK,IAAI;AAAA,MACtF,aAAa,KAAK,YAAY,KAAK,IAAI;AAAA,MACvC,qBAAqB,KAAK,oBAAoB,KAAK,IAAI;AAAA,MACvD,kBAAkB,KAAK,oBAAoB,KAAK,IAAI;AAAA,IACtD;AAAA,EACF;AAAA,EAEA,MAAM,oBAAoB,MAAuD;AAC/E,QAAI,UAAU,IAAI,mBAAmB,KAAK,KAAK;AAAA,MAC7C,mBAAmB,CAAC,IAAI;AAAA,IAC1B,CAAC;AAED,QAAI,cAAc,MAAM,QAAQ,qBAAqB;AAErD,WAAO,MAAM,QAAQ,UAAU;AAAA,MAC7B,cAAc,YAAY,CAAC,EAAE;AAAA,IAC/B,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,YACJ,MACA,QACY;AACZ,QAAI,UAAU,IAAI,mBAAmB,KAAK,KAAK,IAAI;AACnD,QAAI;AACF,aAAO,MAAM,OAAO,OAAO;AAAA,IAC7B,UAAE;AACA,YAAM,QAAQ,MAAM;AAAA,IACtB;AAAA,EACF;AAAA,EAEA,MAAM,oBACJ,UACA,MACA,QAUY;AACZ,WAAO,KAAK,YAAY,MAAM,OAAM,YAAW;AAC7C,UAAI,eAAe,MAAM,SAAS,OAAO;AAEzC,aAAO,OAAO;AAAA,QACZ,GAAG;AAAA,QAEH;AAAA,QAEA,YAAY,QAAQ,WAAW,KAAK,OAAO;AAAA,QAC3C,iBAAiB,QAAQ,gBAAgB,KAAK,OAAO;AAAA,QACrD,WAAW,QAAQ,UAAU,KAAK,OAAO;AAAA,QACzC,sBAAsB,QAAQ,qBAAqB,KAAK,OAAO;AAAA,QAC/D,gBAAgB,QAAQ,eAAe,KAAK,OAAO;AAAA,MACrD,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AACF","sourcesContent":["import { MetorialCoreSDK, createMetorialCoreSDK } from '@metorial/core';\nimport {\n MetorialMcpSession,\n MetorialMcpSessionInit,\n MetorialMcpSessionInitServerDeployments\n} from '@metorial/mcp-session';\n\nexport class Metorial implements MetorialCoreSDK {\n private readonly sdk: MetorialCoreSDK;\n\n constructor(init: Parameters<typeof createMetorialCoreSDK>[0]) {\n this.sdk = createMetorialCoreSDK(init);\n }\n\n get instance() {\n return this.sdk.instance;\n }\n\n get secrets() {\n return this.sdk.secrets;\n }\n\n get servers() {\n return this.sdk.servers;\n }\n\n get sessions() {\n return this.sdk.sessions;\n }\n\n get _config() {\n return this.sdk._config;\n }\n\n get mcp() {\n return {\n createSession: (init: MetorialMcpSessionInit) => new MetorialMcpSession(this.sdk, init),\n withSession: this.withSession.bind(this),\n withProviderSession: this.withProviderSession.bind(this),\n createConnection: this.createMcpConnection.bind(this)\n };\n }\n\n async createMcpConnection(init: MetorialMcpSessionInitServerDeployments[number]) {\n let session = new MetorialMcpSession(this.sdk, {\n serverDeployments: [init]\n });\n\n let deployments = await session.getServerDeployments();\n\n return await session.getClient({\n deploymentId: deployments[0].id\n });\n }\n\n async withSession<T>(\n init: MetorialMcpSessionInit,\n action: (session: MetorialMcpSession) => Promise<T>\n ): Promise<T> {\n let session = new MetorialMcpSession(this.sdk, init);\n try {\n return await action(session);\n } finally {\n await session.close();\n }\n }\n\n async withProviderSession<P, T>(\n provider: (session: MetorialMcpSession) => Promise<P>,\n init: MetorialMcpSessionInit,\n action: (\n input: P & {\n session: MetorialMcpSession;\n getSession: MetorialMcpSession['getSession'];\n getCapabilities: MetorialMcpSession['getCapabilities'];\n getClient: MetorialMcpSession['getClient'];\n getServerDeployments: MetorialMcpSession['getServerDeployments'];\n getToolManager: MetorialMcpSession['getToolManager'];\n }\n ) => Promise<T>\n ): Promise<T> {\n return this.withSession(init, async session => {\n let providerData = await provider(session);\n\n return action({\n ...providerData,\n\n session,\n\n getSession: session.getSession.bind(session),\n getCapabilities: session.getCapabilities.bind(session),\n getClient: session.getClient.bind(session),\n getServerDeployments: session.getServerDeployments.bind(session),\n getToolManager: session.getToolManager.bind(session)\n });\n });\n }\n}\n"]}
package/dist/index.d.cts DELETED
@@ -1,59 +0,0 @@
1
- import * as _metorial_mcp_session from '@metorial/mcp-session';
2
- import { MetorialMcpSessionInit, MetorialMcpSession, MetorialMcpSessionInitServerDeployments } from '@metorial/mcp-session';
3
- import * as _metorial_generated from '@metorial/generated';
4
- import { MetorialCoreSDK, createMetorialCoreSDK } from '@metorial/core';
5
- export * from '@metorial/core';
6
-
7
- declare class Metorial implements MetorialCoreSDK {
8
- private readonly sdk;
9
- constructor(init: Parameters<typeof createMetorialCoreSDK>[0]);
10
- get instance(): _metorial_generated.MetorialInstanceEndpoint;
11
- get secrets(): _metorial_generated.MetorialSecretsEndpoint;
12
- get servers(): _metorial_generated.MetorialServersEndpoint & {
13
- variants: _metorial_generated.MetorialServersVariantsEndpoint;
14
- versions: _metorial_generated.MetorialServersVersionsEndpoint;
15
- deployments: _metorial_generated.MetorialServersDeploymentsEndpoint;
16
- implementations: _metorial_generated.MetorialServersImplementationsEndpoint;
17
- errors: any;
18
- runs: _metorial_generated.MetorialServerRunsEndpoint;
19
- capabilities: _metorial_generated.MetorialServersCapabilitiesEndpoint;
20
- };
21
- get sessions(): _metorial_generated.MetorialSessionsEndpoint & {
22
- messages: _metorial_generated.MetorialSessionsMessagesEndpoint;
23
- connections: _metorial_generated.MetorialSessionsConnectionsEndpoint;
24
- };
25
- get _config(): {
26
- apiVersion: "2025-01-01-pulsar";
27
- apiKey: `${"metorial_uk_" | "metorial_mk_" | "metorial_sk_" | "metorial_ak_" | "metorial_pk_"}${string}` | string;
28
- headers?: Record<string, string>;
29
- apiHost?: string;
30
- mcpHost?: string;
31
- } & {
32
- apiHost: string;
33
- };
34
- get mcp(): {
35
- createSession: (init: MetorialMcpSessionInit) => MetorialMcpSession;
36
- withSession: <T>(init: MetorialMcpSessionInit, action: (session: MetorialMcpSession) => Promise<T>) => Promise<T>;
37
- withProviderSession: <P, T>(provider: (session: MetorialMcpSession) => Promise<P>, init: MetorialMcpSessionInit, action: (input: P & {
38
- session: MetorialMcpSession;
39
- getSession: MetorialMcpSession["getSession"];
40
- getCapabilities: MetorialMcpSession["getCapabilities"];
41
- getClient: MetorialMcpSession["getClient"];
42
- getServerDeployments: MetorialMcpSession["getServerDeployments"];
43
- getToolManager: MetorialMcpSession["getToolManager"];
44
- }) => Promise<T>) => Promise<T>;
45
- createConnection: (init: MetorialMcpSessionInitServerDeployments[number]) => Promise<_metorial_mcp_session.MetorialMcpClient>;
46
- };
47
- createMcpConnection(init: MetorialMcpSessionInitServerDeployments[number]): Promise<_metorial_mcp_session.MetorialMcpClient>;
48
- withSession<T>(init: MetorialMcpSessionInit, action: (session: MetorialMcpSession) => Promise<T>): Promise<T>;
49
- withProviderSession<P, T>(provider: (session: MetorialMcpSession) => Promise<P>, init: MetorialMcpSessionInit, action: (input: P & {
50
- session: MetorialMcpSession;
51
- getSession: MetorialMcpSession['getSession'];
52
- getCapabilities: MetorialMcpSession['getCapabilities'];
53
- getClient: MetorialMcpSession['getClient'];
54
- getServerDeployments: MetorialMcpSession['getServerDeployments'];
55
- getToolManager: MetorialMcpSession['getToolManager'];
56
- }) => Promise<T>): Promise<T>;
57
- }
58
-
59
- export { Metorial };
package/dist/index.d.ts DELETED
@@ -1,59 +0,0 @@
1
- import * as _metorial_mcp_session from '@metorial/mcp-session';
2
- import { MetorialMcpSessionInit, MetorialMcpSession, MetorialMcpSessionInitServerDeployments } from '@metorial/mcp-session';
3
- import * as _metorial_generated from '@metorial/generated';
4
- import { MetorialCoreSDK, createMetorialCoreSDK } from '@metorial/core';
5
- export * from '@metorial/core';
6
-
7
- declare class Metorial implements MetorialCoreSDK {
8
- private readonly sdk;
9
- constructor(init: Parameters<typeof createMetorialCoreSDK>[0]);
10
- get instance(): _metorial_generated.MetorialInstanceEndpoint;
11
- get secrets(): _metorial_generated.MetorialSecretsEndpoint;
12
- get servers(): _metorial_generated.MetorialServersEndpoint & {
13
- variants: _metorial_generated.MetorialServersVariantsEndpoint;
14
- versions: _metorial_generated.MetorialServersVersionsEndpoint;
15
- deployments: _metorial_generated.MetorialServersDeploymentsEndpoint;
16
- implementations: _metorial_generated.MetorialServersImplementationsEndpoint;
17
- errors: any;
18
- runs: _metorial_generated.MetorialServerRunsEndpoint;
19
- capabilities: _metorial_generated.MetorialServersCapabilitiesEndpoint;
20
- };
21
- get sessions(): _metorial_generated.MetorialSessionsEndpoint & {
22
- messages: _metorial_generated.MetorialSessionsMessagesEndpoint;
23
- connections: _metorial_generated.MetorialSessionsConnectionsEndpoint;
24
- };
25
- get _config(): {
26
- apiVersion: "2025-01-01-pulsar";
27
- apiKey: `${"metorial_uk_" | "metorial_mk_" | "metorial_sk_" | "metorial_ak_" | "metorial_pk_"}${string}` | string;
28
- headers?: Record<string, string>;
29
- apiHost?: string;
30
- mcpHost?: string;
31
- } & {
32
- apiHost: string;
33
- };
34
- get mcp(): {
35
- createSession: (init: MetorialMcpSessionInit) => MetorialMcpSession;
36
- withSession: <T>(init: MetorialMcpSessionInit, action: (session: MetorialMcpSession) => Promise<T>) => Promise<T>;
37
- withProviderSession: <P, T>(provider: (session: MetorialMcpSession) => Promise<P>, init: MetorialMcpSessionInit, action: (input: P & {
38
- session: MetorialMcpSession;
39
- getSession: MetorialMcpSession["getSession"];
40
- getCapabilities: MetorialMcpSession["getCapabilities"];
41
- getClient: MetorialMcpSession["getClient"];
42
- getServerDeployments: MetorialMcpSession["getServerDeployments"];
43
- getToolManager: MetorialMcpSession["getToolManager"];
44
- }) => Promise<T>) => Promise<T>;
45
- createConnection: (init: MetorialMcpSessionInitServerDeployments[number]) => Promise<_metorial_mcp_session.MetorialMcpClient>;
46
- };
47
- createMcpConnection(init: MetorialMcpSessionInitServerDeployments[number]): Promise<_metorial_mcp_session.MetorialMcpClient>;
48
- withSession<T>(init: MetorialMcpSessionInit, action: (session: MetorialMcpSession) => Promise<T>): Promise<T>;
49
- withProviderSession<P, T>(provider: (session: MetorialMcpSession) => Promise<P>, init: MetorialMcpSessionInit, action: (input: P & {
50
- session: MetorialMcpSession;
51
- getSession: MetorialMcpSession['getSession'];
52
- getCapabilities: MetorialMcpSession['getCapabilities'];
53
- getClient: MetorialMcpSession['getClient'];
54
- getServerDeployments: MetorialMcpSession['getServerDeployments'];
55
- getToolManager: MetorialMcpSession['getToolManager'];
56
- }) => Promise<T>): Promise<T>;
57
- }
58
-
59
- export { Metorial };
package/dist/index.js DELETED
@@ -1,67 +0,0 @@
1
- import { createMetorialCoreSDK } from '@metorial/core';
2
- import { MetorialMcpSession } from '@metorial/mcp-session';
3
-
4
- // src/metorial.ts
5
- var Metorial = class {
6
- constructor(init) {
7
- this.sdk = createMetorialCoreSDK(init);
8
- }
9
- get instance() {
10
- return this.sdk.instance;
11
- }
12
- get secrets() {
13
- return this.sdk.secrets;
14
- }
15
- get servers() {
16
- return this.sdk.servers;
17
- }
18
- get sessions() {
19
- return this.sdk.sessions;
20
- }
21
- get _config() {
22
- return this.sdk._config;
23
- }
24
- get mcp() {
25
- return {
26
- createSession: (init) => new MetorialMcpSession(this.sdk, init),
27
- withSession: this.withSession.bind(this),
28
- withProviderSession: this.withProviderSession.bind(this),
29
- createConnection: this.createMcpConnection.bind(this)
30
- };
31
- }
32
- async createMcpConnection(init) {
33
- let session = new MetorialMcpSession(this.sdk, {
34
- serverDeployments: [init]
35
- });
36
- let deployments = await session.getServerDeployments();
37
- return await session.getClient({
38
- deploymentId: deployments[0].id
39
- });
40
- }
41
- async withSession(init, action) {
42
- let session = new MetorialMcpSession(this.sdk, init);
43
- try {
44
- return await action(session);
45
- } finally {
46
- await session.close();
47
- }
48
- }
49
- async withProviderSession(provider, init, action) {
50
- return this.withSession(init, async (session) => {
51
- let providerData = await provider(session);
52
- return action({
53
- ...providerData,
54
- session,
55
- getSession: session.getSession.bind(session),
56
- getCapabilities: session.getCapabilities.bind(session),
57
- getClient: session.getClient.bind(session),
58
- getServerDeployments: session.getServerDeployments.bind(session),
59
- getToolManager: session.getToolManager.bind(session)
60
- });
61
- });
62
- }
63
- };
64
-
65
- export { Metorial };
66
- //# sourceMappingURL=out.js.map
67
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/metorial.ts"],"names":[],"mappings":";AAAA,SAA0B,6BAA6B;AACvD;AAAA,EACE;AAAA,OAGK;AAEA,IAAM,WAAN,MAA0C;AAAA,EAG/C,YAAY,MAAmD;AAC7D,SAAK,MAAM,sBAAsB,IAAI;AAAA,EACvC;AAAA,EAEA,IAAI,WAAW;AACb,WAAO,KAAK,IAAI;AAAA,EAClB;AAAA,EAEA,IAAI,UAAU;AACZ,WAAO,KAAK,IAAI;AAAA,EAClB;AAAA,EAEA,IAAI,UAAU;AACZ,WAAO,KAAK,IAAI;AAAA,EAClB;AAAA,EAEA,IAAI,WAAW;AACb,WAAO,KAAK,IAAI;AAAA,EAClB;AAAA,EAEA,IAAI,UAAU;AACZ,WAAO,KAAK,IAAI;AAAA,EAClB;AAAA,EAEA,IAAI,MAAM;AACR,WAAO;AAAA,MACL,eAAe,CAAC,SAAiC,IAAI,mBAAmB,KAAK,KAAK,IAAI;AAAA,MACtF,aAAa,KAAK,YAAY,KAAK,IAAI;AAAA,MACvC,qBAAqB,KAAK,oBAAoB,KAAK,IAAI;AAAA,MACvD,kBAAkB,KAAK,oBAAoB,KAAK,IAAI;AAAA,IACtD;AAAA,EACF;AAAA,EAEA,MAAM,oBAAoB,MAAuD;AAC/E,QAAI,UAAU,IAAI,mBAAmB,KAAK,KAAK;AAAA,MAC7C,mBAAmB,CAAC,IAAI;AAAA,IAC1B,CAAC;AAED,QAAI,cAAc,MAAM,QAAQ,qBAAqB;AAErD,WAAO,MAAM,QAAQ,UAAU;AAAA,MAC7B,cAAc,YAAY,CAAC,EAAE;AAAA,IAC/B,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,YACJ,MACA,QACY;AACZ,QAAI,UAAU,IAAI,mBAAmB,KAAK,KAAK,IAAI;AACnD,QAAI;AACF,aAAO,MAAM,OAAO,OAAO;AAAA,IAC7B,UAAE;AACA,YAAM,QAAQ,MAAM;AAAA,IACtB;AAAA,EACF;AAAA,EAEA,MAAM,oBACJ,UACA,MACA,QAUY;AACZ,WAAO,KAAK,YAAY,MAAM,OAAM,YAAW;AAC7C,UAAI,eAAe,MAAM,SAAS,OAAO;AAEzC,aAAO,OAAO;AAAA,QACZ,GAAG;AAAA,QAEH;AAAA,QAEA,YAAY,QAAQ,WAAW,KAAK,OAAO;AAAA,QAC3C,iBAAiB,QAAQ,gBAAgB,KAAK,OAAO;AAAA,QACrD,WAAW,QAAQ,UAAU,KAAK,OAAO;AAAA,QACzC,sBAAsB,QAAQ,qBAAqB,KAAK,OAAO;AAAA,QAC/D,gBAAgB,QAAQ,eAAe,KAAK,OAAO;AAAA,MACrD,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AACF","sourcesContent":["import { MetorialCoreSDK, createMetorialCoreSDK } from '@metorial/core';\nimport {\n MetorialMcpSession,\n MetorialMcpSessionInit,\n MetorialMcpSessionInitServerDeployments\n} from '@metorial/mcp-session';\n\nexport class Metorial implements MetorialCoreSDK {\n private readonly sdk: MetorialCoreSDK;\n\n constructor(init: Parameters<typeof createMetorialCoreSDK>[0]) {\n this.sdk = createMetorialCoreSDK(init);\n }\n\n get instance() {\n return this.sdk.instance;\n }\n\n get secrets() {\n return this.sdk.secrets;\n }\n\n get servers() {\n return this.sdk.servers;\n }\n\n get sessions() {\n return this.sdk.sessions;\n }\n\n get _config() {\n return this.sdk._config;\n }\n\n get mcp() {\n return {\n createSession: (init: MetorialMcpSessionInit) => new MetorialMcpSession(this.sdk, init),\n withSession: this.withSession.bind(this),\n withProviderSession: this.withProviderSession.bind(this),\n createConnection: this.createMcpConnection.bind(this)\n };\n }\n\n async createMcpConnection(init: MetorialMcpSessionInitServerDeployments[number]) {\n let session = new MetorialMcpSession(this.sdk, {\n serverDeployments: [init]\n });\n\n let deployments = await session.getServerDeployments();\n\n return await session.getClient({\n deploymentId: deployments[0].id\n });\n }\n\n async withSession<T>(\n init: MetorialMcpSessionInit,\n action: (session: MetorialMcpSession) => Promise<T>\n ): Promise<T> {\n let session = new MetorialMcpSession(this.sdk, init);\n try {\n return await action(session);\n } finally {\n await session.close();\n }\n }\n\n async withProviderSession<P, T>(\n provider: (session: MetorialMcpSession) => Promise<P>,\n init: MetorialMcpSessionInit,\n action: (\n input: P & {\n session: MetorialMcpSession;\n getSession: MetorialMcpSession['getSession'];\n getCapabilities: MetorialMcpSession['getCapabilities'];\n getClient: MetorialMcpSession['getClient'];\n getServerDeployments: MetorialMcpSession['getServerDeployments'];\n getToolManager: MetorialMcpSession['getToolManager'];\n }\n ) => Promise<T>\n ): Promise<T> {\n return this.withSession(init, async session => {\n let providerData = await provider(session);\n\n return action({\n ...providerData,\n\n session,\n\n getSession: session.getSession.bind(session),\n getCapabilities: session.getCapabilities.bind(session),\n getClient: session.getClient.bind(session),\n getServerDeployments: session.getServerDeployments.bind(session),\n getToolManager: session.getToolManager.bind(session)\n });\n });\n }\n}\n"]}