@agent-tasks/mcp-server 0.12.0 → 0.14.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 +108 -23
- package/dist/client.d.ts +88 -21
- package/dist/client.js +189 -14
- package/dist/client.js.map +1 -1
- package/dist/default-workflow.d.ts +23 -0
- package/dist/default-workflow.js +107 -0
- package/dist/default-workflow.js.map +1 -0
- package/dist/errors.d.ts +87 -0
- package/dist/errors.js +1402 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.js +16 -1
- package/dist/index.js.map +1 -1
- package/dist/legacy-flag.d.ts +1 -0
- package/dist/legacy-flag.js +36 -0
- package/dist/legacy-flag.js.map +1 -0
- package/dist/primer.d.ts +15 -0
- package/dist/primer.js +89 -0
- package/dist/primer.js.map +1 -0
- package/dist/read.d.ts +133 -0
- package/dist/read.js +193 -0
- package/dist/read.js.map +1 -0
- package/dist/receipt.d.ts +293 -0
- package/dist/receipt.js +622 -0
- package/dist/receipt.js.map +1 -0
- package/dist/server.d.ts +8 -3
- package/dist/server.js +22 -9
- package/dist/server.js.map +1 -1
- package/dist/tools.d.ts +3 -1
- package/dist/tools.js +417 -70
- package/dist/tools.js.map +1 -1
- package/package.json +4 -2
package/dist/server.d.ts
CHANGED
|
@@ -2,8 +2,13 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
|
2
2
|
import { type ClientConfig } from "./client.js";
|
|
3
3
|
export declare const DEFAULT_BASE_URL = "https://agent-tasks.opentriologue.ai";
|
|
4
4
|
export declare const SERVER_NAME = "agent-tasks-mcp";
|
|
5
|
-
export declare const SERVER_VERSION = "0.
|
|
6
|
-
export declare function
|
|
7
|
-
export declare function
|
|
5
|
+
export declare const SERVER_VERSION = "0.14.0";
|
|
6
|
+
export declare function serializeResult(result: unknown): string;
|
|
7
|
+
export declare function createServer(config: ClientConfig, options?: {
|
|
8
|
+
legacy?: boolean;
|
|
9
|
+
}): McpServer;
|
|
10
|
+
export declare function runStdioServer(config: ClientConfig, options?: {
|
|
11
|
+
legacy?: boolean;
|
|
12
|
+
}): Promise<void>;
|
|
8
13
|
export { AgentTasksClient, type ClientConfig } from "./client.js";
|
|
9
14
|
export { buildTools } from "./tools.js";
|
package/dist/server.js
CHANGED
|
@@ -2,16 +2,31 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
|
2
2
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
3
|
import { AgentTasksClient } from "./client.js";
|
|
4
4
|
import { buildTools } from "./tools.js";
|
|
5
|
+
import { HANDSHAKE_PRIMER } from "./primer.js";
|
|
5
6
|
export const DEFAULT_BASE_URL = "https://agent-tasks.opentriologue.ai";
|
|
6
7
|
export const SERVER_NAME = "agent-tasks-mcp";
|
|
7
|
-
export const SERVER_VERSION = "0.
|
|
8
|
-
|
|
8
|
+
export const SERVER_VERSION = "0.14.0";
|
|
9
|
+
// Wire-format serializer: the exact transform applied to every tool
|
|
10
|
+
// handler's return value before it goes out as the MCP text block. Exported
|
|
11
|
+
// so tests measuring a receipt's emitted size (the response-contract-v1.md
|
|
12
|
+
// token budgets) serialize through this same function instead of a
|
|
13
|
+
// hand-rolled compact JSON.stringify that would under-measure the real,
|
|
14
|
+
// pretty-printed payload and let a budget regression slip past the suite.
|
|
15
|
+
export function serializeResult(result) {
|
|
16
|
+
return typeof result === "string" ? result : JSON.stringify(result, null, 2);
|
|
17
|
+
}
|
|
18
|
+
export function createServer(config, options) {
|
|
9
19
|
const client = new AgentTasksClient(config);
|
|
10
|
-
const tools = buildTools(client);
|
|
20
|
+
const tools = buildTools(client, options);
|
|
21
|
+
// docs/response-contract-v1.md's "Onboarding channels by rate of change":
|
|
22
|
+
// system/lifecycle/verb-order knowledge is sent once per session via this
|
|
23
|
+
// `instructions` field instead of being replayed on every write-verb
|
|
24
|
+
// response. See primer.ts for the budgeted text and its `workflow_primer`
|
|
25
|
+
// on-demand companion (registered below via buildTools).
|
|
11
26
|
const server = new McpServer({
|
|
12
27
|
name: SERVER_NAME,
|
|
13
28
|
version: SERVER_VERSION,
|
|
14
|
-
});
|
|
29
|
+
}, { instructions: HANDSHAKE_PRIMER });
|
|
15
30
|
for (const tool of tools) {
|
|
16
31
|
server.registerTool(tool.name, {
|
|
17
32
|
description: tool.description,
|
|
@@ -23,9 +38,7 @@ export function createServer(config) {
|
|
|
23
38
|
content: [
|
|
24
39
|
{
|
|
25
40
|
type: "text",
|
|
26
|
-
text:
|
|
27
|
-
? result
|
|
28
|
-
: JSON.stringify(result, null, 2),
|
|
41
|
+
text: serializeResult(result),
|
|
29
42
|
},
|
|
30
43
|
],
|
|
31
44
|
};
|
|
@@ -41,8 +54,8 @@ export function createServer(config) {
|
|
|
41
54
|
}
|
|
42
55
|
return server;
|
|
43
56
|
}
|
|
44
|
-
export async function runStdioServer(config) {
|
|
45
|
-
const server = createServer(config);
|
|
57
|
+
export async function runStdioServer(config, options) {
|
|
58
|
+
const server = createServer(config, options);
|
|
46
59
|
const transport = new StdioServerTransport();
|
|
47
60
|
await server.connect(transport);
|
|
48
61
|
}
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAqB,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAqB,MAAM,aAAa,CAAC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IAAa,CAAC,CAAC;gBACjD,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,eAAe,CAAC,MAAM,CAAC;yBAC9B;qBACF;iBACF,CAAC;YACJ,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;gBACjE,OAAO;oBACL,OAAO,EAAE,IAAI;oBACb,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;iBAC3C,CAAC;YACJ,CAAC;QACH,CAAC,CACF,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,MAAoB,EACpB,OAA8B;IAE9B,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7C,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC;AAED,OAAO,EAAE,gBAAgB,EAAqB,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/tools.d.ts
CHANGED
|
@@ -6,4 +6,6 @@ export interface ToolDefinition<Shape extends ZodRawShape = ZodRawShape> {
|
|
|
6
6
|
inputShape: Shape;
|
|
7
7
|
handler: (args: z.objectOutputType<Shape, z.ZodTypeAny>) => Promise<unknown>;
|
|
8
8
|
}
|
|
9
|
-
export declare function buildTools(client: AgentTasksClient
|
|
9
|
+
export declare function buildTools(client: AgentTasksClient, options?: {
|
|
10
|
+
legacy?: boolean;
|
|
11
|
+
}): ToolDefinition[];
|