@knocklabs/agent-toolkit 0.1.4 → 0.1.5
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.
|
@@ -7,11 +7,11 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
var KnockMcpServer = class extends McpServer {
|
|
9
9
|
constructor(knockClient, config, tools) {
|
|
10
|
-
super({ name: "Knock", version: "0.1.
|
|
10
|
+
super({ name: "Knock", version: "0.1.5" });
|
|
11
11
|
tools.forEach((tool) => {
|
|
12
12
|
const toolParams = tool.parameters ?? z.object({});
|
|
13
13
|
this.tool(
|
|
14
|
-
tool.
|
|
14
|
+
tool.method,
|
|
15
15
|
tool.description,
|
|
16
16
|
toolParams.shape,
|
|
17
17
|
async (arg) => {
|
|
@@ -36,4 +36,4 @@ var createKnockMcpServer = async (params) => {
|
|
|
36
36
|
export {
|
|
37
37
|
createKnockMcpServer
|
|
38
38
|
};
|
|
39
|
-
//# sourceMappingURL=chunk-
|
|
39
|
+
//# sourceMappingURL=chunk-IYDITNVL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/modelcontextprotocol/adapter.ts","../src/modelcontextprotocol/index.ts"],"sourcesContent":["import { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport { z } from \"zod\";\nimport type { KnockTool } from \"../lib/knock-tool.js\";\nimport { Config } from \"../types.js\";\nimport { KnockClient } from \"../lib/knock-client.js\";\n\nexport class KnockMcpServer extends McpServer {\n constructor(knockClient: KnockClient, config: Config, tools: KnockTool[]) {\n super({ name: \"Knock\", version: PACKAGE_VERSION });\n\n tools.forEach((tool) => {\n const toolParams = tool.parameters ?? z.object({});\n\n this.tool(\n tool.method,\n tool.description,\n toolParams.shape,\n async (arg: unknown) => {\n const res = await tool.bindExecute(knockClient, config)(arg);\n\n return {\n content: [{ type: \"text\" as const, text: JSON.stringify(res) }],\n };\n }\n );\n });\n }\n}\n","import type { KnockTool } from \"../lib/knock-tool.js\";\nimport { allTools } from \"../lib/tools/index.js\";\nimport { KnockMcpServer } from \"./adapter.js\";\nimport { Config } from \"../types.js\";\nimport { KnockClient } from \"../lib/knock-client.js\";\n\ntype CreateKnockMcpServerParams = {\n /**\n * Array of Knock tools to enable in the server.\n */\n tools?: KnockTool[];\n\n /**\n * A Knock client to use for the server.\n */\n knockClient: KnockClient;\n\n /**\n * The config to use for the server.\n */\n config: Config;\n};\n\n/**\n * Creates a Knock MCP Server with the given parameters.\n */\nexport const createKnockMcpServer = async (\n params: CreateKnockMcpServerParams\n): Promise<KnockMcpServer> => {\n const { tools, knockClient, config } = params;\n\n return Promise.resolve(\n new KnockMcpServer(knockClient, config, tools || Object.values(allTools))\n );\n};\n"],"mappings":";;;;;AAAA,SAAS,iBAAiB;AAC1B,SAAS,SAAS;AAKX,IAAM,iBAAN,cAA6B,UAAU;AAAA,EAC5C,YAAY,aAA0B,QAAgB,OAAoB;AACxE,UAAM,EAAE,MAAM,SAAS,SAAS,QAAgB,CAAC;AAEjD,UAAM,QAAQ,CAAC,SAAS;AACtB,YAAM,aAAa,KAAK,cAAc,EAAE,OAAO,CAAC,CAAC;AAEjD,WAAK;AAAA,QACH,KAAK;AAAA,QACL,KAAK;AAAA,QACL,WAAW;AAAA,QACX,OAAO,QAAiB;AACtB,gBAAM,MAAM,MAAM,KAAK,YAAY,aAAa,MAAM,EAAE,GAAG;AAE3D,iBAAO;AAAA,YACL,SAAS,CAAC,EAAE,MAAM,QAAiB,MAAM,KAAK,UAAU,GAAG,EAAE,CAAC;AAAA,UAChE;AAAA,QACF;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AACF;;;ACDO,IAAM,uBAAuB,OAClC,WAC4B;AAC5B,QAAM,EAAE,OAAO,aAAa,OAAO,IAAI;AAEvC,SAAO,QAAQ;AAAA,IACb,IAAI,eAAe,aAAa,QAAQ,SAAS,OAAO,OAAO,QAAQ,CAAC;AAAA,EAC1E;AACF;","names":[]}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/modelcontextprotocol/adapter.ts","../src/modelcontextprotocol/index.ts"],"sourcesContent":["import { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport { z } from \"zod\";\nimport type { KnockTool } from \"../lib/knock-tool.js\";\nimport { Config } from \"../types.js\";\nimport { KnockClient } from \"../lib/knock-client.js\";\n\nexport class KnockMcpServer extends McpServer {\n constructor(knockClient: KnockClient, config: Config, tools: KnockTool[]) {\n super({ name: \"Knock\", version: \"0.1.0\" });\n\n tools.forEach((tool) => {\n const toolParams = tool.parameters ?? z.object({});\n\n this.tool(\n tool.name,\n tool.description,\n toolParams.shape,\n async (arg: unknown) => {\n const res = await tool.bindExecute(knockClient, config)(arg);\n\n return {\n content: [{ type: \"text\" as const, text: JSON.stringify(res) }],\n };\n }\n );\n });\n }\n}\n","import type { KnockTool } from \"../lib/knock-tool.js\";\nimport { allTools } from \"../lib/tools/index.js\";\nimport { KnockMcpServer } from \"./adapter.js\";\nimport { Config } from \"../types.js\";\nimport { KnockClient } from \"../lib/knock-client.js\";\n\ntype CreateKnockMcpServerParams = {\n /**\n * Array of Knock tools to enable in the server.\n */\n tools?: KnockTool[];\n\n /**\n * A Knock client to use for the server.\n */\n knockClient: KnockClient;\n\n /**\n * The config to use for the server.\n */\n config: Config;\n};\n\n/**\n * Creates a Knock MCP Server with the given parameters.\n */\nexport const createKnockMcpServer = async (\n params: CreateKnockMcpServerParams\n): Promise<KnockMcpServer> => {\n const { tools, knockClient, config } = params;\n\n return Promise.resolve(\n new KnockMcpServer(knockClient, config, tools || Object.values(allTools))\n );\n};\n"],"mappings":";;;;;AAAA,SAAS,iBAAiB;AAC1B,SAAS,SAAS;AAKX,IAAM,iBAAN,cAA6B,UAAU;AAAA,EAC5C,YAAY,aAA0B,QAAgB,OAAoB;AACxE,UAAM,EAAE,MAAM,SAAS,SAAS,QAAQ,CAAC;AAEzC,UAAM,QAAQ,CAAC,SAAS;AACtB,YAAM,aAAa,KAAK,cAAc,EAAE,OAAO,CAAC,CAAC;AAEjD,WAAK;AAAA,QACH,KAAK;AAAA,QACL,KAAK;AAAA,QACL,WAAW;AAAA,QACX,OAAO,QAAiB;AACtB,gBAAM,MAAM,MAAM,KAAK,YAAY,aAAa,MAAM,EAAE,GAAG;AAE3D,iBAAO;AAAA,YACL,SAAS,CAAC,EAAE,MAAM,QAAiB,MAAM,KAAK,UAAU,GAAG,EAAE,CAAC;AAAA,UAChE;AAAA,QACF;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AACF;;;ACDO,IAAM,uBAAuB,OAClC,WAC4B;AAC5B,QAAM,EAAE,OAAO,aAAa,OAAO,IAAI;AAEvC,SAAO,QAAQ;AAAA,IACb,IAAI,eAAe,aAAa,QAAQ,SAAS,OAAO,OAAO,QAAQ,CAAC;AAAA,EAC1E;AACF;","names":[]}
|