@jrmc/adonis-mcp 1.0.0-alpha.13 → 1.0.0-alpha.14
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 +223 -21
- package/build/commands/commands.json +1 -1
- package/build/commands/inspector.d.ts +16 -0
- package/build/commands/inspector.d.ts.map +1 -0
- package/build/commands/inspector.js +54 -0
- package/build/src/server/contents/audio.d.ts +1 -1
- package/build/src/server/contents/audio.d.ts.map +1 -1
- package/build/src/server/contents/blob.d.ts +1 -1
- package/build/src/server/contents/blob.d.ts.map +1 -1
- package/build/src/server/contents/embedded_resource.d.ts +1 -1
- package/build/src/server/contents/embedded_resource.d.ts.map +1 -1
- package/build/src/server/contents/error.d.ts +1 -1
- package/build/src/server/contents/error.d.ts.map +1 -1
- package/build/src/server/contents/image.d.ts +1 -1
- package/build/src/server/contents/image.d.ts.map +1 -1
- package/build/src/server/contents/resource_link.d.ts +1 -1
- package/build/src/server/contents/resource_link.d.ts.map +1 -1
- package/build/src/server/contents/structured.d.ts +1 -1
- package/build/src/server/contents/structured.d.ts.map +1 -1
- package/build/src/server/contents/text.d.ts +1 -1
- package/build/src/server/contents/text.d.ts.map +1 -1
- package/build/src/server/context.d.ts +5 -1
- package/build/src/server/context.d.ts.map +1 -1
- package/build/src/server/context.js +26 -0
- package/build/src/server/{content.d.ts → contracts/content.d.ts} +4 -4
- package/build/src/server/contracts/content.d.ts.map +1 -0
- package/build/src/server/contracts/context.d.ts +29 -0
- package/build/src/server/contracts/context.d.ts.map +1 -0
- package/build/src/{types → server/contracts}/transport.d.ts +1 -1
- package/build/src/server/contracts/transport.d.ts.map +1 -0
- package/build/src/server/contracts/transport.js +7 -0
- package/build/src/server/methods/call_tool.d.ts +1 -1
- package/build/src/server/methods/call_tool.d.ts.map +1 -1
- package/build/src/server/methods/get_prompt.d.ts +1 -1
- package/build/src/server/methods/get_prompt.d.ts.map +1 -1
- package/build/src/server/methods/initialize.d.ts +1 -1
- package/build/src/server/methods/initialize.d.ts.map +1 -1
- package/build/src/server/methods/list_prompts.d.ts +1 -1
- package/build/src/server/methods/list_prompts.d.ts.map +1 -1
- package/build/src/server/methods/list_prompts.js +1 -16
- package/build/src/server/methods/list_resource_templates.d.ts +12 -0
- package/build/src/server/methods/list_resource_templates.d.ts.map +1 -0
- package/build/src/server/methods/list_resource_templates.js +31 -0
- package/build/src/server/methods/list_resources.d.ts +1 -1
- package/build/src/server/methods/list_resources.d.ts.map +1 -1
- package/build/src/server/methods/list_resources.js +2 -9
- package/build/src/server/methods/list_tools.d.ts +1 -1
- package/build/src/server/methods/list_tools.d.ts.map +1 -1
- package/build/src/server/methods/list_tools.js +1 -16
- package/build/src/server/methods/ping.d.ts +1 -1
- package/build/src/server/methods/ping.d.ts.map +1 -1
- package/build/src/server/methods/read_resource.d.ts +1 -1
- package/build/src/server/methods/read_resource.d.ts.map +1 -1
- package/build/src/server/methods/read_resource.js +13 -1
- package/build/src/server/prompt.d.ts +13 -9
- package/build/src/server/prompt.d.ts.map +1 -1
- package/build/src/server/prompt.js +17 -0
- package/build/src/server/resource.d.ts +11 -8
- package/build/src/server/resource.d.ts.map +1 -1
- package/build/src/server/resource.js +23 -0
- package/build/src/server/tool.d.ts +13 -9
- package/build/src/server/tool.d.ts.map +1 -1
- package/build/src/server/tool.js +17 -0
- package/build/src/server/transports/fake_transport.d.ts +2 -2
- package/build/src/server/transports/fake_transport.d.ts.map +1 -1
- package/build/src/server/transports/http_transport.d.ts +2 -2
- package/build/src/server/transports/http_transport.d.ts.map +1 -1
- package/build/src/server/transports/stdio_transport.d.ts +1 -1
- package/build/src/server/transports/stdio_transport.d.ts.map +1 -1
- package/build/src/server.d.ts +2 -1
- package/build/src/server.d.ts.map +1 -1
- package/build/src/server.js +1 -0
- package/build/src/types/content.d.ts +1 -1
- package/build/src/types/content.d.ts.map +1 -1
- package/build/src/types/context.d.ts +9 -22
- package/build/src/types/context.d.ts.map +1 -1
- package/build/src/types/method.d.ts +1 -1
- package/build/src/types/method.d.ts.map +1 -1
- package/build/src/utils/uri_template.d.ts +25 -0
- package/build/src/utils/uri_template.d.ts.map +1 -0
- package/build/src/utils/uri_template.js +240 -0
- package/build/stubs/make/mcp/prompts/main.ts.stub +3 -4
- package/build/stubs/make/mcp/resources/main.ts.stub +1 -1
- package/build/stubs/make/mcp/tools/main.ts.stub +3 -5
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -1
- package/build/src/server/content.d.ts.map +0 -1
- package/build/src/types/transport.d.ts.map +0 -1
- /package/build/src/server/{content.js → contracts/content.js} +0 -0
- /package/build/src/{types/transport.js → server/contracts/context.js} +0 -0
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright Jeremy Chaufourier <jeremy@chaufourier.fr>
|
|
6
6
|
*/
|
|
7
|
-
import type { ToolResponse, ResourceResponse, PromptResponse } from '
|
|
8
|
-
import type { Resource } from '
|
|
9
|
-
import type { AnyTool as Tool } from '
|
|
10
|
-
import type { AnyPrompt as Prompt } from '
|
|
7
|
+
import type { ToolResponse, ResourceResponse, PromptResponse } from '../../types/response.js';
|
|
8
|
+
import type { Resource } from '../resource.js';
|
|
9
|
+
import type { AnyTool as Tool } from '../tool.js';
|
|
10
|
+
import type { AnyPrompt as Prompt } from '../prompt.js';
|
|
11
11
|
export declare abstract class Content {
|
|
12
12
|
abstract toTool(tool: Tool): ToolResponse;
|
|
13
13
|
abstract toPrompt(prompt: Prompt): PromptResponse;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../../src/server/contracts/content.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAC7F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,KAAK,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,YAAY,CAAA;AACjD,OAAO,KAAK,EAAE,SAAS,IAAI,MAAM,EAAE,MAAM,cAAc,CAAA;AACvD,8BAAsB,OAAO;IAC3B,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,YAAY;IACzC,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc;IACjD,QAAQ,CAAC,UAAU,CAAC,QAAQ,EAAE,QAAQ,GAAG,gBAAgB;CAC1D"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jrmc/adonis-mcp
|
|
3
|
+
*
|
|
4
|
+
* @license MIT
|
|
5
|
+
* @copyright Jeremy Chaufourier <jeremy@chaufourier.fr>
|
|
6
|
+
*/
|
|
7
|
+
import type { ToolList, ResourceList, PromptList } from '../../types/method.js';
|
|
8
|
+
import type { McpRequest, McpRequestType } from '../../types/request.js';
|
|
9
|
+
import type { McpResourceResponse, McpToolResponse, McpPromptResponse } from '../../types/response.js';
|
|
10
|
+
export interface McpContext {
|
|
11
|
+
requestType: McpRequestType;
|
|
12
|
+
supportedProtocolVersions: string[];
|
|
13
|
+
serverCapabilities: Record<string, any>;
|
|
14
|
+
serverName: string;
|
|
15
|
+
serverVersion: string;
|
|
16
|
+
instructions: string;
|
|
17
|
+
maxPaginationLength: number;
|
|
18
|
+
defaultPaginationLength: number;
|
|
19
|
+
tools: ToolList;
|
|
20
|
+
resources: ResourceList;
|
|
21
|
+
resourceTemplates?: string[];
|
|
22
|
+
prompts: PromptList;
|
|
23
|
+
request: McpRequest;
|
|
24
|
+
response: this['requestType'] extends 'resource' ? McpResourceResponse : this['requestType'] extends 'prompt' ? McpPromptResponse : McpToolResponse;
|
|
25
|
+
getPerPage(requestedPerPage?: number): number;
|
|
26
|
+
getResources(): Promise<ResourceList>;
|
|
27
|
+
getResourceTemplates(): Promise<ResourceList>;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/server/contracts/context.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAC/E,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AACxE,OAAO,KAAK,EACV,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EAClB,MAAM,yBAAyB,CAAA;AAEhC,MAAM,WAAW,UAAU;IACzB,WAAW,EAAE,cAAc,CAAA;IAE3B,yBAAyB,EAAE,MAAM,EAAE,CAAA;IACnC,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACvC,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;IACrB,YAAY,EAAE,MAAM,CAAA;IACpB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,uBAAuB,EAAE,MAAM,CAAA;IAC/B,KAAK,EAAE,QAAQ,CAAA;IACf,SAAS,EAAE,YAAY,CAAA;IACvB,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC5B,OAAO,EAAE,UAAU,CAAA;IACnB,OAAO,EAAE,UAAU,CAAA;IACnB,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,SAAS,UAAU,GAC5C,mBAAmB,GACnB,IAAI,CAAC,aAAa,CAAC,SAAS,QAAQ,GAClC,iBAAiB,GACjB,eAAe,CAAA;IAErB,UAAU,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC7C,YAAY,IAAI,OAAO,CAAC,YAAY,CAAC,CAAA;IACrC,oBAAoB,IAAI,OAAO,CAAC,YAAY,CAAC,CAAA;CAC9C"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @copyright Jeremy Chaufourier <jeremy@chaufourier.fr>
|
|
6
6
|
*/
|
|
7
7
|
import type { McpContext } from './context.js';
|
|
8
|
-
import type { JsonRpcResponse } from '
|
|
8
|
+
import type { JsonRpcResponse } from '../../types/jsonrpc.js';
|
|
9
9
|
export interface Transport {
|
|
10
10
|
bindBouncer?(mcpContext: McpContext): void;
|
|
11
11
|
bindAuth?(mcpContext: McpContext): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../../../src/server/contracts/transport.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAE7D,MAAM,WAAW,SAAS;IACxB,WAAW,CAAC,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CAAA;IAC1C,QAAQ,CAAC,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CAAA;IACvC,IAAI,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI,CAAA;CACrC"}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright Jeremy Chaufourier <jeremy@chaufourier.fr>
|
|
6
6
|
*/
|
|
7
|
+
import type { McpContext } from '../contracts/context.js';
|
|
7
8
|
import type { Method } from '../../types/method.js';
|
|
8
|
-
import type { McpContext } from '../../types/context.js';
|
|
9
9
|
export default class CallTool implements Method {
|
|
10
10
|
handle(ctx: McpContext): Promise<import("../../types/jsonrpc.js").JsonRpcResponse>;
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"call_tool.d.ts","sourceRoot":"","sources":["../../../../src/server/methods/call_tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"call_tool.d.ts","sourceRoot":"","sources":["../../../../src/server/methods/call_tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAYnD,MAAM,CAAC,OAAO,OAAO,QAAS,YAAW,MAAM;IACvC,MAAM,CAAC,GAAG,EAAE,UAAU;CAsE7B"}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright Jeremy Chaufourier <jeremy@chaufourier.fr>
|
|
6
6
|
*/
|
|
7
|
+
import type { McpContext } from '../contracts/context.js';
|
|
7
8
|
import type { Method } from '../../types/method.js';
|
|
8
|
-
import type { McpContext } from '../../types/context.js';
|
|
9
9
|
export default class GetPrompt implements Method {
|
|
10
10
|
handle(ctx: McpContext): Promise<import("../../types/jsonrpc.js").JsonRpcResponse>;
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get_prompt.d.ts","sourceRoot":"","sources":["../../../../src/server/methods/get_prompt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"get_prompt.d.ts","sourceRoot":"","sources":["../../../../src/server/methods/get_prompt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AASnD,MAAM,CAAC,OAAO,OAAO,SAAU,YAAW,MAAM;IACxC,MAAM,CAAC,GAAG,EAAE,UAAU;CA+E7B"}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright Jeremy Chaufourier <jeremy@chaufourier.fr>
|
|
6
6
|
*/
|
|
7
|
+
import type { McpContext } from '../contracts/context.js';
|
|
7
8
|
import type { Method } from '../../types/method.js';
|
|
8
|
-
import type { McpContext } from '../../types/context.js';
|
|
9
9
|
export default class Initialize implements Method {
|
|
10
10
|
handle(ctx: McpContext): import("../../types/jsonrpc.js").JsonRpcResponse;
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.d.ts","sourceRoot":"","sources":["../../../../src/server/methods/initialize.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"initialize.d.ts","sourceRoot":"","sources":["../../../../src/server/methods/initialize.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAMnD,MAAM,CAAC,OAAO,OAAO,UAAW,YAAW,MAAM;IAC/C,MAAM,CAAC,GAAG,EAAE,UAAU;CAgCvB"}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright Jeremy Chaufourier <jeremy@chaufourier.fr>
|
|
6
6
|
*/
|
|
7
|
+
import type { McpContext } from '../contracts/context.js';
|
|
7
8
|
import type { Method } from '../../types/method.js';
|
|
8
|
-
import type { McpContext } from '../../types/context.js';
|
|
9
9
|
export default class ListPrompts implements Method {
|
|
10
10
|
handle(ctx: McpContext): Promise<import("../../types/jsonrpc.js").JsonRpcResponse>;
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list_prompts.d.ts","sourceRoot":"","sources":["../../../../src/server/methods/list_prompts.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"list_prompts.d.ts","sourceRoot":"","sources":["../../../../src/server/methods/list_prompts.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAOnD,MAAM,CAAC,OAAO,OAAO,WAAY,YAAW,MAAM;IAC1C,MAAM,CAAC,GAAG,EAAE,UAAU;CAiC7B"}
|
|
@@ -17,22 +17,7 @@ export default class ListPrompts {
|
|
|
17
17
|
try {
|
|
18
18
|
const { default: Prompt } = await import(filepath);
|
|
19
19
|
const prompt = new Prompt();
|
|
20
|
-
|
|
21
|
-
? prompt.schema()
|
|
22
|
-
: {
|
|
23
|
-
type: 'object',
|
|
24
|
-
properties: {},
|
|
25
|
-
};
|
|
26
|
-
return {
|
|
27
|
-
name: prompt.name,
|
|
28
|
-
title: prompt.title,
|
|
29
|
-
description: prompt.description,
|
|
30
|
-
inputSchema: {
|
|
31
|
-
type: schema.type,
|
|
32
|
-
properties: schema.properties,
|
|
33
|
-
required: schema.required ?? [],
|
|
34
|
-
},
|
|
35
|
-
};
|
|
20
|
+
return prompt.toJson();
|
|
36
21
|
}
|
|
37
22
|
catch (error) {
|
|
38
23
|
throw new JsonRpcException(`Error listing prompt`, ErrorCode.InternalError, ctx.request.id, { error });
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jrmc/adonis-mcp
|
|
3
|
+
*
|
|
4
|
+
* @license MIT
|
|
5
|
+
* @copyright Jeremy Chaufourier <jeremy@chaufourier.fr>
|
|
6
|
+
*/
|
|
7
|
+
import type { McpContext } from '../contracts/context.js';
|
|
8
|
+
import type { Method } from '../../types/method.js';
|
|
9
|
+
export default class ListResourceTemplates implements Method {
|
|
10
|
+
handle(ctx: McpContext): Promise<import("../../types/jsonrpc.js").JsonRpcResponse>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=list_resource_templates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list_resource_templates.d.ts","sourceRoot":"","sources":["../../../../src/server/methods/list_resource_templates.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAOnD,MAAM,CAAC,OAAO,OAAO,qBAAsB,YAAW,MAAM;IACpD,MAAM,CAAC,GAAG,EAAE,UAAU;CAiC7B"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jrmc/adonis-mcp
|
|
3
|
+
*
|
|
4
|
+
* @license MIT
|
|
5
|
+
* @copyright Jeremy Chaufourier <jeremy@chaufourier.fr>
|
|
6
|
+
*/
|
|
7
|
+
import { ErrorCode } from '../../enums/error.js';
|
|
8
|
+
import JsonRpcException from '../exceptions/jsonrpc_exception.js';
|
|
9
|
+
import { CursorPaginator } from '../pagination/cursor_paginator.js';
|
|
10
|
+
import Response from '../../response.js';
|
|
11
|
+
export default class ListResourceTemplates {
|
|
12
|
+
async handle(ctx) {
|
|
13
|
+
let nextCursor;
|
|
14
|
+
const paginator = new CursorPaginator(Object.values(await ctx.getResourceTemplates()), ctx.getPerPage(), ctx.request.params?.cursor);
|
|
15
|
+
const paginatedResources = paginator.paginate('resourceTemplates');
|
|
16
|
+
const resourceTemplates = await Promise.all(paginatedResources['resourceTemplates'].map(async (filepath) => {
|
|
17
|
+
try {
|
|
18
|
+
const { default: Resource } = await import(filepath);
|
|
19
|
+
const resource = new Resource();
|
|
20
|
+
return resource.toJson();
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
throw new JsonRpcException(`Error listing resource`, ErrorCode.InternalError, ctx.request.id, { error });
|
|
24
|
+
}
|
|
25
|
+
}));
|
|
26
|
+
if (paginatedResources.nextCursor) {
|
|
27
|
+
nextCursor = paginatedResources.nextCursor;
|
|
28
|
+
}
|
|
29
|
+
return Response.toJsonRpc({ id: ctx.request.id, result: { resourceTemplates, nextCursor } });
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright Jeremy Chaufourier <jeremy@chaufourier.fr>
|
|
6
6
|
*/
|
|
7
|
+
import type { McpContext } from '../contracts/context.js';
|
|
7
8
|
import type { Method } from '../../types/method.js';
|
|
8
|
-
import type { McpContext } from '../../types/context.js';
|
|
9
9
|
export default class ListResources implements Method {
|
|
10
10
|
handle(ctx: McpContext): Promise<import("../../types/jsonrpc.js").JsonRpcResponse>;
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list_resources.d.ts","sourceRoot":"","sources":["../../../../src/server/methods/list_resources.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"list_resources.d.ts","sourceRoot":"","sources":["../../../../src/server/methods/list_resources.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAOnD,MAAM,CAAC,OAAO,OAAO,aAAc,YAAW,MAAM;IAC5C,MAAM,CAAC,GAAG,EAAE,UAAU;CAiC7B"}
|
|
@@ -11,20 +11,13 @@ import Response from '../../response.js';
|
|
|
11
11
|
export default class ListResources {
|
|
12
12
|
async handle(ctx) {
|
|
13
13
|
let nextCursor;
|
|
14
|
-
const paginator = new CursorPaginator(Object.values(ctx.
|
|
14
|
+
const paginator = new CursorPaginator(Object.values(await ctx.getResources()), ctx.getPerPage(), ctx.request.params?.cursor);
|
|
15
15
|
const paginatedResources = paginator.paginate('resources');
|
|
16
16
|
const resources = await Promise.all(paginatedResources['resources'].map(async (filepath) => {
|
|
17
17
|
try {
|
|
18
18
|
const { default: Resource } = await import(filepath);
|
|
19
19
|
const resource = new Resource();
|
|
20
|
-
return
|
|
21
|
-
name: resource.name,
|
|
22
|
-
uri: resource.uri,
|
|
23
|
-
title: resource.title,
|
|
24
|
-
description: resource.description,
|
|
25
|
-
size: resource.size,
|
|
26
|
-
mimeType: resource.mimeType,
|
|
27
|
-
};
|
|
20
|
+
return resource.toJson();
|
|
28
21
|
}
|
|
29
22
|
catch (error) {
|
|
30
23
|
throw new JsonRpcException(`Error listing resource`, ErrorCode.InternalError, ctx.request.id, { error });
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright Jeremy Chaufourier <jeremy@chaufourier.fr>
|
|
6
6
|
*/
|
|
7
|
+
import type { McpContext } from '../contracts/context.js';
|
|
7
8
|
import type { Method } from '../../types/method.js';
|
|
8
|
-
import type { McpContext } from '../../types/context.js';
|
|
9
9
|
export default class ListTools implements Method {
|
|
10
10
|
handle(ctx: McpContext): Promise<import("../../types/jsonrpc.js").JsonRpcResponse>;
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list_tools.d.ts","sourceRoot":"","sources":["../../../../src/server/methods/list_tools.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"list_tools.d.ts","sourceRoot":"","sources":["../../../../src/server/methods/list_tools.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAOnD,MAAM,CAAC,OAAO,OAAO,SAAU,YAAW,MAAM;IACxC,MAAM,CAAC,GAAG,EAAE,UAAU;CAiC7B"}
|
|
@@ -17,22 +17,7 @@ export default class ListTools {
|
|
|
17
17
|
try {
|
|
18
18
|
const { default: Tool } = await import(filepath);
|
|
19
19
|
const tool = new Tool();
|
|
20
|
-
|
|
21
|
-
? tool.schema()
|
|
22
|
-
: {
|
|
23
|
-
type: 'object',
|
|
24
|
-
properties: {},
|
|
25
|
-
};
|
|
26
|
-
return {
|
|
27
|
-
name: tool.name,
|
|
28
|
-
title: tool.title,
|
|
29
|
-
description: tool.description,
|
|
30
|
-
inputSchema: {
|
|
31
|
-
type: schema.type,
|
|
32
|
-
properties: schema.properties,
|
|
33
|
-
required: schema.required ?? [],
|
|
34
|
-
},
|
|
35
|
-
};
|
|
20
|
+
return tool.toJson();
|
|
36
21
|
}
|
|
37
22
|
catch (error) {
|
|
38
23
|
throw new JsonRpcException(`Error listing tool`, ErrorCode.InternalError, ctx.request.id, { error });
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright Jeremy Chaufourier <jeremy@chaufourier.fr>
|
|
6
6
|
*/
|
|
7
|
+
import type { McpContext } from '../contracts/context.js';
|
|
7
8
|
import type { Method } from '../../types/method.js';
|
|
8
|
-
import type { McpContext } from '../../types/context.js';
|
|
9
9
|
export default class Ping implements Method {
|
|
10
10
|
handle(ctx: McpContext): import("../../types/jsonrpc.js").JsonRpcResponse;
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ping.d.ts","sourceRoot":"","sources":["../../../../src/server/methods/ping.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"ping.d.ts","sourceRoot":"","sources":["../../../../src/server/methods/ping.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAInD,MAAM,CAAC,OAAO,OAAO,IAAK,YAAW,MAAM;IACzC,MAAM,CAAC,GAAG,EAAE,UAAU;CAGvB"}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright Jeremy Chaufourier <jeremy@chaufourier.fr>
|
|
6
6
|
*/
|
|
7
|
+
import type { McpContext } from '../contracts/context.js';
|
|
7
8
|
import type { Method } from '../../types/method.js';
|
|
8
|
-
import type { McpContext } from '../../types/context.js';
|
|
9
9
|
export default class ReadResource implements Method {
|
|
10
10
|
handle(ctx: McpContext): Promise<import("../../types/jsonrpc.js").JsonRpcResponse>;
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read_resource.d.ts","sourceRoot":"","sources":["../../../../src/server/methods/read_resource.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"read_resource.d.ts","sourceRoot":"","sources":["../../../../src/server/methods/read_resource.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AASnD,MAAM,CAAC,OAAO,OAAO,YAAa,YAAW,MAAM;IAC3C,MAAM,CAAC,GAAG,EAAE,UAAU;CA+C7B"}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import { ErrorCode } from '../../enums/error.js';
|
|
8
8
|
import JsonRpcException from '../exceptions/jsonrpc_exception.js';
|
|
9
9
|
import Response from '../../response.js';
|
|
10
|
+
import { UriTemplate } from '../../utils/uri_template.js';
|
|
10
11
|
export default class ReadResource {
|
|
11
12
|
async handle(ctx) {
|
|
12
13
|
const resourceContext = ctx;
|
|
@@ -14,7 +15,18 @@ export default class ReadResource {
|
|
|
14
15
|
if (!params?.uri) {
|
|
15
16
|
throw new JsonRpcException(`The resource URI is required.`, ErrorCode.InvalidParams, resourceContext.request.id);
|
|
16
17
|
}
|
|
17
|
-
const item = Object.keys(resourceContext.resources).find((key) =>
|
|
18
|
+
const item = Object.keys(resourceContext.resources).find((key) => {
|
|
19
|
+
if (key === params.uri) {
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
const uriTemplate = new UriTemplate(key);
|
|
23
|
+
const variables = uriTemplate.match(params.uri);
|
|
24
|
+
if (variables) {
|
|
25
|
+
;
|
|
26
|
+
resourceContext.args = variables ?? {};
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
18
30
|
if (!item) {
|
|
19
31
|
throw new JsonRpcException(`The resource ${params.uri} was not found.`, ErrorCode.MethodNotFound, resourceContext.request.id);
|
|
20
32
|
}
|
|
@@ -4,17 +4,21 @@
|
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright Jeremy Chaufourier <jeremy@chaufourier.fr>
|
|
6
6
|
*/
|
|
7
|
-
import type {
|
|
7
|
+
import type { JSONSchema } from '../types/method.js';
|
|
8
8
|
import type { PromptContext } from '../types/context.js';
|
|
9
|
-
import type { Content } from '
|
|
10
|
-
export declare abstract class Prompt<T extends JSONSchema> {
|
|
9
|
+
import type { Content } from './contracts/content.js';
|
|
10
|
+
export declare abstract class Prompt<T extends JSONSchema = JSONSchema> {
|
|
11
11
|
abstract name: string;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
title?: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
schema(): T;
|
|
15
|
+
toJson(): {
|
|
16
|
+
name: string;
|
|
17
|
+
title: string | undefined;
|
|
18
|
+
description: string | undefined;
|
|
19
|
+
inputSchema: T;
|
|
20
|
+
};
|
|
21
|
+
abstract handle(ctx?: PromptContext<T>): Promise<Content | Content[]>;
|
|
18
22
|
}
|
|
19
23
|
export type AnyPrompt = Prompt<JSONSchema>;
|
|
20
24
|
//# sourceMappingURL=prompt.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../../src/server/prompt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../../src/server/prompt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAErD,8BAAsB,MAAM,CAAC,CAAC,SAAS,UAAU,GAAG,UAAU;IAC5D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB,MAAM,IAAI,CAAC;IAOX,MAAM;;;;;;IAWN,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,OAAO,GAAG,OAAO,EAAE,CAAC;CACtE;AAED,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,UAAU,CAAC,CAAA"}
|
|
@@ -5,4 +5,21 @@
|
|
|
5
5
|
* @copyright Jeremy Chaufourier <jeremy@chaufourier.fr>
|
|
6
6
|
*/
|
|
7
7
|
export class Prompt {
|
|
8
|
+
title;
|
|
9
|
+
description;
|
|
10
|
+
schema() {
|
|
11
|
+
return {
|
|
12
|
+
type: 'object',
|
|
13
|
+
properties: {},
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
toJson() {
|
|
17
|
+
const schema = this.schema();
|
|
18
|
+
return {
|
|
19
|
+
name: this.name,
|
|
20
|
+
title: this.title,
|
|
21
|
+
description: this.description,
|
|
22
|
+
inputSchema: schema,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
8
25
|
}
|
|
@@ -5,14 +5,17 @@
|
|
|
5
5
|
* @copyright Jeremy Chaufourier <jeremy@chaufourier.fr>
|
|
6
6
|
*/
|
|
7
7
|
import type { ResourceContext } from '../types/context.js';
|
|
8
|
-
import type { Content } from '
|
|
9
|
-
export declare abstract class Resource {
|
|
10
|
-
|
|
11
|
-
abstract title?: string;
|
|
12
|
-
abstract description?: string;
|
|
8
|
+
import type { Content } from './contracts/content.js';
|
|
9
|
+
export declare abstract class Resource<T = {}> {
|
|
10
|
+
uri: string;
|
|
13
11
|
abstract name: string;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
title?: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
mimeType?: string;
|
|
15
|
+
size?: number;
|
|
16
|
+
toJson(): Record<string, unknown>;
|
|
17
|
+
abstract handle(ctx?: ResourceContext & {
|
|
18
|
+
args?: T;
|
|
19
|
+
}): Promise<Content>;
|
|
17
20
|
}
|
|
18
21
|
//# sourceMappingURL=resource.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../../src/server/resource.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../../src/server/resource.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAKrD,8BAAsB,QAAQ,CAAC,CAAC,GAAG,EAAE;IACnC,GAAG,EAAE,MAAM,CAA+D;IAC1E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb,MAAM;IAkBN,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,eAAe,GAAG;QAAE,IAAI,CAAC,EAAE,CAAC,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,CAAC;CACxE"}
|
|
@@ -4,5 +4,28 @@
|
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright Jeremy Chaufourier <jeremy@chaufourier.fr>
|
|
6
6
|
*/
|
|
7
|
+
import string from '@adonisjs/core/helpers/string';
|
|
8
|
+
import { UriTemplate } from '../utils/uri_template.js';
|
|
7
9
|
export class Resource {
|
|
10
|
+
uri = `file://resources/${string.dashCase(this.constructor.name)}`;
|
|
11
|
+
title;
|
|
12
|
+
description;
|
|
13
|
+
mimeType;
|
|
14
|
+
size;
|
|
15
|
+
toJson() {
|
|
16
|
+
const data = {
|
|
17
|
+
name: this.name,
|
|
18
|
+
title: this.title,
|
|
19
|
+
description: this.description,
|
|
20
|
+
size: this.size,
|
|
21
|
+
mimeType: this.mimeType,
|
|
22
|
+
};
|
|
23
|
+
if (UriTemplate.isTemplate(this.uri)) {
|
|
24
|
+
data.uriTemplate = this.uri;
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
data.uri = this.uri;
|
|
28
|
+
}
|
|
29
|
+
return data;
|
|
30
|
+
}
|
|
8
31
|
}
|
|
@@ -4,17 +4,21 @@
|
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright Jeremy Chaufourier <jeremy@chaufourier.fr>
|
|
6
6
|
*/
|
|
7
|
-
import type {
|
|
7
|
+
import type { JSONSchema } from '../types/method.js';
|
|
8
8
|
import type { ToolContext } from '../types/context.js';
|
|
9
|
-
import type { Content } from '
|
|
10
|
-
export declare abstract class Tool<T extends JSONSchema> {
|
|
9
|
+
import type { Content } from './contracts/content.js';
|
|
10
|
+
export declare abstract class Tool<T extends JSONSchema = JSONSchema> {
|
|
11
11
|
abstract name: string;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
title?: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
schema(): T;
|
|
15
|
+
toJson(): {
|
|
16
|
+
name: string;
|
|
17
|
+
title: string | undefined;
|
|
18
|
+
description: string | undefined;
|
|
19
|
+
inputSchema: T;
|
|
20
|
+
};
|
|
21
|
+
abstract handle(ctx?: ToolContext<T>): Promise<Content | Content[]>;
|
|
18
22
|
}
|
|
19
23
|
export type AnyTool = Tool<JSONSchema>;
|
|
20
24
|
//# sourceMappingURL=tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../../src/server/tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../../src/server/tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAErD,8BAAsB,IAAI,CAAC,CAAC,SAAS,UAAU,GAAG,UAAU;IAC1D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB,MAAM,IAAI,CAAC;IAOX,MAAM;;;;;;IAWN,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,OAAO,GAAG,OAAO,EAAE,CAAC;CACpE;AAED,MAAM,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,CAAA"}
|
package/build/src/server/tool.js
CHANGED
|
@@ -5,4 +5,21 @@
|
|
|
5
5
|
* @copyright Jeremy Chaufourier <jeremy@chaufourier.fr>
|
|
6
6
|
*/
|
|
7
7
|
export class Tool {
|
|
8
|
+
title;
|
|
9
|
+
description;
|
|
10
|
+
schema() {
|
|
11
|
+
return {
|
|
12
|
+
type: 'object',
|
|
13
|
+
properties: {},
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
toJson() {
|
|
17
|
+
const schema = this.schema();
|
|
18
|
+
return {
|
|
19
|
+
name: this.name,
|
|
20
|
+
title: this.title,
|
|
21
|
+
description: this.description,
|
|
22
|
+
inputSchema: schema,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
8
25
|
}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright Jeremy Chaufourier <jeremy@chaufourier.fr>
|
|
6
6
|
*/
|
|
7
|
-
import type { McpContext } from '
|
|
8
|
-
import type { Transport } from '
|
|
7
|
+
import type { McpContext } from '../contracts/context.js';
|
|
8
|
+
import type { Transport } from '../contracts/transport.js';
|
|
9
9
|
import type { JsonRpcResponse } from '../../types/jsonrpc.js';
|
|
10
10
|
export default class FakeTransport implements Transport {
|
|
11
11
|
sentMessages: JsonRpcResponse[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fake_transport.d.ts","sourceRoot":"","sources":["../../../../src/server/transports/fake_transport.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"fake_transport.d.ts","sourceRoot":"","sources":["../../../../src/server/transports/fake_transport.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAE7D,MAAM,CAAC,OAAO,OAAO,aAAc,YAAW,SAAS;IACrD,YAAY,EAAE,eAAe,EAAE,CAAK;IACpC,oBAAoB,EAAE,CAAC,CAAC,GAAG,EAAE,UAAU,KAAK,IAAI,CAAC,EAAE,CAAK;IACxD,iBAAiB,EAAE,CAAC,CAAC,GAAG,EAAE,UAAU,KAAK,IAAI,CAAC,EAAE,CAAK;IAErD,IAAI,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI;IAIpC,WAAW,CAAC,CAAC,GAAG,EAAE,UAAU,GAAG,IAAI;IAInC,QAAQ,CAAC,CAAC,GAAG,EAAE,UAAU,GAAG,IAAI;IAIhC,KAAK,IAAI,IAAI;IAMb,cAAc,IAAI,eAAe,GAAG,SAAS;CAG9C"}
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* @copyright Jeremy Chaufourier <jeremy@chaufourier.fr>
|
|
6
6
|
*/
|
|
7
7
|
import type { HttpContext } from '@adonisjs/core/http';
|
|
8
|
-
import type { McpContext } from '
|
|
9
|
-
import type { Transport } from '
|
|
8
|
+
import type { McpContext } from '../contracts/context.js';
|
|
9
|
+
import type { Transport } from '../contracts/transport.js';
|
|
10
10
|
import type { JsonRpcResponse } from '../../types/jsonrpc.js';
|
|
11
11
|
export default class HttpTransport implements Transport {
|
|
12
12
|
#private;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http_transport.d.ts","sourceRoot":"","sources":["../../../../src/server/transports/http_transport.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"http_transport.d.ts","sourceRoot":"","sources":["../../../../src/server/transports/http_transport.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAE7D,MAAM,CAAC,OAAO,OAAO,aAAc,YAAW,SAAS;;gBAEzC,GAAG,EAAE,WAAW;IAI5B,WAAW,CAAC,UAAU,EAAE,UAAU;IAMlC,QAAQ,CAAC,UAAU,EAAE,UAAU;IAM/B,IAAI,CAAC,OAAO,EAAE,eAAe;CAG9B"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright Jeremy Chaufourier <jeremy@chaufourier.fr>
|
|
6
6
|
*/
|
|
7
|
-
import type { Transport } from '
|
|
7
|
+
import type { Transport } from '../contracts/transport.js';
|
|
8
8
|
import type { JsonRpcResponse } from '../../types/jsonrpc.js';
|
|
9
9
|
import { EventEmitter } from 'node:events';
|
|
10
10
|
export default class StdioTransport extends EventEmitter implements Transport {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stdio_transport.d.ts","sourceRoot":"","sources":["../../../../src/server/transports/stdio_transport.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"stdio_transport.d.ts","sourceRoot":"","sources":["../../../../src/server/transports/stdio_transport.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAI7D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1C,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,YAAa,YAAW,SAAS;;IAK3E,MAAM,GAAI,OAAO,MAAM,UAGtB;;IAOK,iBAAiB;IAavB,IAAI,CAAC,OAAO,EAAE,eAAe;CAG9B"}
|