@epiccontext/mcp 0.1.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/dist/api/client.d.ts +126 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/api/client.js +152 -0
- package/dist/api/client.js.map +1 -0
- package/dist/bin/epicontext.d.ts +18 -0
- package/dist/bin/epicontext.d.ts.map +1 -0
- package/dist/bin/epicontext.js +18 -0
- package/dist/bin/epicontext.js.map +1 -0
- package/dist/cli/commands/init.d.ts +5 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +61 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/link.d.ts +6 -0
- package/dist/cli/commands/link.d.ts.map +1 -0
- package/dist/cli/commands/link.js +158 -0
- package/dist/cli/commands/link.js.map +1 -0
- package/dist/cli/commands/pull.d.ts +6 -0
- package/dist/cli/commands/pull.d.ts.map +1 -0
- package/dist/cli/commands/pull.js +51 -0
- package/dist/cli/commands/pull.js.map +1 -0
- package/dist/cli/commands/push.d.ts +6 -0
- package/dist/cli/commands/push.d.ts.map +1 -0
- package/dist/cli/commands/push.js +64 -0
- package/dist/cli/commands/push.js.map +1 -0
- package/dist/cli/commands/serve.d.ts +5 -0
- package/dist/cli/commands/serve.d.ts.map +1 -0
- package/dist/cli/commands/serve.js +42 -0
- package/dist/cli/commands/serve.js.map +1 -0
- package/dist/cli/commands/status.d.ts +2 -0
- package/dist/cli/commands/status.d.ts.map +1 -0
- package/dist/cli/commands/status.js +85 -0
- package/dist/cli/commands/status.js.map +1 -0
- package/dist/cli/commands/sync.d.ts +7 -0
- package/dist/cli/commands/sync.d.ts.map +1 -0
- package/dist/cli/commands/sync.js +91 -0
- package/dist/cli/commands/sync.js.map +1 -0
- package/dist/cli/commands/watch.d.ts +6 -0
- package/dist/cli/commands/watch.d.ts.map +1 -0
- package/dist/cli/commands/watch.js +66 -0
- package/dist/cli/commands/watch.js.map +1 -0
- package/dist/cli/config.d.ts +39 -0
- package/dist/cli/config.d.ts.map +1 -0
- package/dist/cli/config.js +133 -0
- package/dist/cli/config.js.map +1 -0
- package/dist/cli/files.d.ts +29 -0
- package/dist/cli/files.d.ts.map +1 -0
- package/dist/cli/files.js +158 -0
- package/dist/cli/files.js.map +1 -0
- package/dist/cli/index.d.ts +5 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +85 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +36 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/server.d.ts +12 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +93 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tools/create-block.d.ts +10 -0
- package/dist/mcp/tools/create-block.d.ts.map +1 -0
- package/dist/mcp/tools/create-block.js +88 -0
- package/dist/mcp/tools/create-block.js.map +1 -0
- package/dist/mcp/tools/get-block.d.ts +10 -0
- package/dist/mcp/tools/get-block.d.ts.map +1 -0
- package/dist/mcp/tools/get-block.js +70 -0
- package/dist/mcp/tools/get-block.js.map +1 -0
- package/dist/mcp/tools/get-sync-status.d.ts +10 -0
- package/dist/mcp/tools/get-sync-status.d.ts.map +1 -0
- package/dist/mcp/tools/get-sync-status.js +41 -0
- package/dist/mcp/tools/get-sync-status.js.map +1 -0
- package/dist/mcp/tools/list-blocks.d.ts +10 -0
- package/dist/mcp/tools/list-blocks.d.ts.map +1 -0
- package/dist/mcp/tools/list-blocks.js +65 -0
- package/dist/mcp/tools/list-blocks.js.map +1 -0
- package/dist/mcp/tools/read-context.d.ts +10 -0
- package/dist/mcp/tools/read-context.d.ts.map +1 -0
- package/dist/mcp/tools/read-context.js +138 -0
- package/dist/mcp/tools/read-context.js.map +1 -0
- package/dist/mcp/tools/sync-all.d.ts +10 -0
- package/dist/mcp/tools/sync-all.d.ts.map +1 -0
- package/dist/mcp/tools/sync-all.js +67 -0
- package/dist/mcp/tools/sync-all.js.map +1 -0
- package/dist/mcp/tools/sync-from-app.d.ts +10 -0
- package/dist/mcp/tools/sync-from-app.d.ts.map +1 -0
- package/dist/mcp/tools/sync-from-app.js +40 -0
- package/dist/mcp/tools/sync-from-app.js.map +1 -0
- package/dist/mcp/tools/sync-to-app.d.ts +10 -0
- package/dist/mcp/tools/sync-to-app.d.ts.map +1 -0
- package/dist/mcp/tools/sync-to-app.js +53 -0
- package/dist/mcp/tools/sync-to-app.js.map +1 -0
- package/dist/mcp/tools/update-block.d.ts +10 -0
- package/dist/mcp/tools/update-block.d.ts.map +1 -0
- package/dist/mcp/tools/update-block.js +90 -0
- package/dist/mcp/tools/update-block.js.map +1 -0
- package/dist/sync/pull.d.ts +16 -0
- package/dist/sync/pull.d.ts.map +1 -0
- package/dist/sync/pull.js +32 -0
- package/dist/sync/pull.js.map +1 -0
- package/dist/sync/push.d.ts +18 -0
- package/dist/sync/push.d.ts.map +1 -0
- package/dist/sync/push.js +39 -0
- package/dist/sync/push.js.map +1 -0
- package/dist/sync/watcher.d.ts +51 -0
- package/dist/sync/watcher.d.ts.map +1 -0
- package/dist/sync/watcher.js +114 -0
- package/dist/sync/watcher.js.map +1 -0
- package/dist/types/index.d.ts +110 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +56 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export const getBlockTool = {
|
|
2
|
+
name: "get_block",
|
|
3
|
+
description: "Get a specific block by its key.",
|
|
4
|
+
inputSchema: {
|
|
5
|
+
type: "object",
|
|
6
|
+
properties: {
|
|
7
|
+
key: {
|
|
8
|
+
type: "string",
|
|
9
|
+
description: "The unique key of the block to retrieve",
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
required: ["key"],
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
export async function handleGetBlock(config, args) {
|
|
16
|
+
const key = args.key;
|
|
17
|
+
if (!key) {
|
|
18
|
+
return {
|
|
19
|
+
content: [
|
|
20
|
+
{
|
|
21
|
+
type: "text",
|
|
22
|
+
text: "Error: Block key is required.",
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
try {
|
|
28
|
+
const response = await config.client.getBlock(key);
|
|
29
|
+
const block = response.block;
|
|
30
|
+
if (!block) {
|
|
31
|
+
return {
|
|
32
|
+
content: [
|
|
33
|
+
{
|
|
34
|
+
type: "text",
|
|
35
|
+
text: `Block not found: ${key}`,
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
let output = `# ${block.name || block.key}\n\n`;
|
|
41
|
+
output += `- **Key:** ${block.key}\n`;
|
|
42
|
+
output += `- **Type:** ${block.type}\n`;
|
|
43
|
+
output += `- **Section:** ${block.section_type || "unknown"}\n`;
|
|
44
|
+
output += `- **Status:** ${block.status}\n`;
|
|
45
|
+
output += `- **Updated:** ${block.updated_at}\n\n`;
|
|
46
|
+
output += `## Content\n\n`;
|
|
47
|
+
output += "```json\n";
|
|
48
|
+
output += JSON.stringify(block.value, null, 2);
|
|
49
|
+
output += "\n```";
|
|
50
|
+
return {
|
|
51
|
+
content: [
|
|
52
|
+
{
|
|
53
|
+
type: "text",
|
|
54
|
+
text: output,
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
return {
|
|
61
|
+
content: [
|
|
62
|
+
{
|
|
63
|
+
type: "text",
|
|
64
|
+
text: `Error retrieving block: ${error.message}`,
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=get-block.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-block.js","sourceRoot":"","sources":["../../../src/mcp/tools/get-block.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B,KAAK,CAAC,UAAU,MAAM,CAAC;QACnD,MAAM,IAAI,gBAAgB,CAAC;QAC3B,MAAM,IAAI,WAAW,CAAC;QACtB,MAAM,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAC/C,MAAM,IAAI,OAAO,CAAC;QAElB,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,MAAM;iBACb;aACF;SACF,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,2BAA4B,KAAe,CAAC,OAAO,EAAE;iBAC5D;aACF;SACF,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import type { McpServerConfig } from "../server.js";
|
|
3
|
+
export declare const getSyncStatusTool: Tool;
|
|
4
|
+
export declare function handleGetSyncStatus(config: McpServerConfig, _args: Record<string, unknown>): Promise<{
|
|
5
|
+
content: Array<{
|
|
6
|
+
type: string;
|
|
7
|
+
text: string;
|
|
8
|
+
}>;
|
|
9
|
+
}>;
|
|
10
|
+
//# sourceMappingURL=get-sync-status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-sync-status.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/get-sync-status.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAGpD,eAAO,MAAM,iBAAiB,EAAE,IAQ/B,CAAC;AAEF,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAiC7D"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { readContextFolder } from "../../cli/files.js";
|
|
2
|
+
export const getSyncStatusTool = {
|
|
3
|
+
name: "get_sync_status",
|
|
4
|
+
description: "Get the current sync status between local CONTEXT folder and EpicContext cloud",
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: "object",
|
|
7
|
+
properties: {},
|
|
8
|
+
},
|
|
9
|
+
};
|
|
10
|
+
export async function handleGetSyncStatus(config, _args) {
|
|
11
|
+
// Get cloud status
|
|
12
|
+
const cloudStatus = await config.client.getSyncStatus();
|
|
13
|
+
// Count local files
|
|
14
|
+
const localFiles = readContextFolder(config.contextPath);
|
|
15
|
+
const status = {
|
|
16
|
+
connected: true,
|
|
17
|
+
project: {
|
|
18
|
+
id: cloudStatus.projectId,
|
|
19
|
+
name: cloudStatus.projectName,
|
|
20
|
+
slug: cloudStatus.projectSlug,
|
|
21
|
+
},
|
|
22
|
+
local: {
|
|
23
|
+
path: config.config.sync.path,
|
|
24
|
+
fileCount: localFiles.length,
|
|
25
|
+
},
|
|
26
|
+
sync: {
|
|
27
|
+
lastSyncAt: cloudStatus.sync.lastSyncAt,
|
|
28
|
+
lastSyncDirection: cloudStatus.sync.lastSyncDirection,
|
|
29
|
+
conflictResolution: config.config.sync.conflictResolution,
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
return {
|
|
33
|
+
content: [
|
|
34
|
+
{
|
|
35
|
+
type: "text",
|
|
36
|
+
text: JSON.stringify(status, null, 2),
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=get-sync-status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+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+1,10 @@
|
|
|
1
|
+
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import type { McpServerConfig } from "../server.js";
|
|
3
|
+
export declare const listBlocksTool: Tool;
|
|
4
|
+
export declare function handleListBlocks(config: McpServerConfig, args: Record<string, unknown>): Promise<{
|
|
5
|
+
content: Array<{
|
|
6
|
+
type: string;
|
|
7
|
+
text: string;
|
|
8
|
+
}>;
|
|
9
|
+
}>;
|
|
10
|
+
//# sourceMappingURL=list-blocks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-blocks.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/list-blocks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAGpD,eAAO,MAAM,cAAc,EAAE,IAkB5B,CAAC;AAEF,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,eAAe,EACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAoD7D"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export const listBlocksTool = {
|
|
2
|
+
name: "list_blocks",
|
|
3
|
+
description: "List all blocks in the project, optionally filtered by section.",
|
|
4
|
+
inputSchema: {
|
|
5
|
+
type: "object",
|
|
6
|
+
properties: {
|
|
7
|
+
section: {
|
|
8
|
+
type: "string",
|
|
9
|
+
description: "Filter by section type (e.g., 'brand', 'product')",
|
|
10
|
+
},
|
|
11
|
+
status: {
|
|
12
|
+
type: "string",
|
|
13
|
+
enum: ["empty", "draft", "complete"],
|
|
14
|
+
description: "Filter by block status",
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
export async function handleListBlocks(config, args) {
|
|
20
|
+
const section = args.section;
|
|
21
|
+
const status = args.status;
|
|
22
|
+
const response = await config.client.listBlocks({ section, status });
|
|
23
|
+
const blocks = response.blocks;
|
|
24
|
+
if (blocks.length === 0) {
|
|
25
|
+
return {
|
|
26
|
+
content: [
|
|
27
|
+
{
|
|
28
|
+
type: "text",
|
|
29
|
+
text: "No blocks found matching the criteria.",
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
// Group blocks by section for better readability
|
|
35
|
+
const bySection = {};
|
|
36
|
+
for (const block of blocks) {
|
|
37
|
+
const sectionType = block.section_type || "unknown";
|
|
38
|
+
if (!bySection[sectionType]) {
|
|
39
|
+
bySection[sectionType] = [];
|
|
40
|
+
}
|
|
41
|
+
bySection[sectionType].push(block);
|
|
42
|
+
}
|
|
43
|
+
let output = `Found ${blocks.length} blocks:\n\n`;
|
|
44
|
+
for (const [sectionType, sectionBlocks] of Object.entries(bySection)) {
|
|
45
|
+
output += `## ${sectionType}\n`;
|
|
46
|
+
for (const block of sectionBlocks) {
|
|
47
|
+
const statusIcon = block.status === "complete"
|
|
48
|
+
? "[x]"
|
|
49
|
+
: block.status === "draft"
|
|
50
|
+
? "[-]"
|
|
51
|
+
: "[ ]";
|
|
52
|
+
output += `${statusIcon} ${block.key} (${block.type})\n`;
|
|
53
|
+
}
|
|
54
|
+
output += "\n";
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
content: [
|
|
58
|
+
{
|
|
59
|
+
type: "text",
|
|
60
|
+
text: output,
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=list-blocks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-blocks.js","sourceRoot":"","sources":["../../../src/mcp/tools/list-blocks.ts"],"names":[],"mapp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AAC;IAED,IAAI,MAAM,GAAG,SAAS,MAAM,CAAC,MAAM,cAAc,CAAC;IAElD,KAAK,MAAM,CAAC,WAAW,EAAE,aAAa,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;QACrE,MAAM,IAAI,MAAM,WAAW,IAAI,CAAC;QAChC,KAAK,MAAM,KAAK,IAAI,aAAa,EAAE,CAAC;YAClC,MAAM,UAAU,GACd,KAAK,CAAC,MAAM,KAAK,UAAU;gBACzB,CAAC,CAAC,KAAK;gBACP,CAAC,CAAC,KAAK,CAAC,MAAM,KAAK,OAAO;oBACxB,CAAC,CAAC,KAAK;oBACP,CAAC,CAAC,KAAK,CAAC;YACd,MAAM,IAAI,GAAG,UAAU,IAAI,KAAK,CAAC,GAAG,KAAK,KAAK,CAAC,IAAI,KAAK,CAAC;QAC3D,CAAC;QACD,MAAM,IAAI,IAAI,CAAC;IACjB,CAAC;IAED,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,MAAM;aACb;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import type { McpServerConfig } from "../server.js";
|
|
3
|
+
export declare const readContextTool: Tool;
|
|
4
|
+
export declare function handleReadContext(config: McpServerConfig, args: Record<string, unknown>): Promise<{
|
|
5
|
+
content: Array<{
|
|
6
|
+
type: string;
|
|
7
|
+
text: string;
|
|
8
|
+
}>;
|
|
9
|
+
}>;
|
|
10
|
+
//# sourceMappingURL=read-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-context.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/read-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAMpD,eAAO,MAAM,eAAe,EAAE,IAmB7B,CAAC;AAEF,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,eAAe,EACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CA+H7D"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { readContextFolder } from "../../cli/files.js";
|
|
2
|
+
import { resolve, relative } from "path";
|
|
3
|
+
import { readFile } from "fs/promises";
|
|
4
|
+
export const readContextTool = {
|
|
5
|
+
name: "read_context",
|
|
6
|
+
description: "Read context files from the local CONTEXT folder. Returns markdown content for AI consumption.",
|
|
7
|
+
inputSchema: {
|
|
8
|
+
type: "object",
|
|
9
|
+
properties: {
|
|
10
|
+
path: {
|
|
11
|
+
type: "string",
|
|
12
|
+
description: "Specific file or section to read (e.g., 'brand/colors.md'). Leave empty for all.",
|
|
13
|
+
},
|
|
14
|
+
format: {
|
|
15
|
+
type: "string",
|
|
16
|
+
enum: ["markdown", "json"],
|
|
17
|
+
description: "Output format (default: markdown)",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
export async function handleReadContext(config, args) {
|
|
23
|
+
const requestedPath = args.path;
|
|
24
|
+
const format = args.format || "markdown";
|
|
25
|
+
try {
|
|
26
|
+
// If specific path requested, read just that file
|
|
27
|
+
if (requestedPath) {
|
|
28
|
+
const fullPath = resolve(config.contextPath, requestedPath);
|
|
29
|
+
// Security check - ensure path is within context folder
|
|
30
|
+
const relativePath = relative(config.contextPath, fullPath);
|
|
31
|
+
if (relativePath.startsWith("..")) {
|
|
32
|
+
return {
|
|
33
|
+
content: [
|
|
34
|
+
{
|
|
35
|
+
type: "text",
|
|
36
|
+
text: "Error: Path must be within CONTEXT folder.",
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
try {
|
|
42
|
+
const content = await readFile(fullPath, "utf-8");
|
|
43
|
+
if (format === "json") {
|
|
44
|
+
return {
|
|
45
|
+
content: [
|
|
46
|
+
{
|
|
47
|
+
type: "text",
|
|
48
|
+
text: JSON.stringify({ path: requestedPath, content }, null, 2),
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
content: [
|
|
55
|
+
{
|
|
56
|
+
type: "text",
|
|
57
|
+
text: `# ${requestedPath}\n\n${content}`,
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
return {
|
|
64
|
+
content: [
|
|
65
|
+
{
|
|
66
|
+
type: "text",
|
|
67
|
+
text: `File not found: ${requestedPath}`,
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
// Read all context files
|
|
74
|
+
const files = readContextFolder(config.contextPath);
|
|
75
|
+
if (files.length === 0) {
|
|
76
|
+
return {
|
|
77
|
+
content: [
|
|
78
|
+
{
|
|
79
|
+
type: "text",
|
|
80
|
+
text: "No context files found in CONTEXT folder.",
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
if (format === "json") {
|
|
86
|
+
const result = files.map((f) => ({
|
|
87
|
+
path: f.path,
|
|
88
|
+
content: f.content,
|
|
89
|
+
}));
|
|
90
|
+
return {
|
|
91
|
+
content: [
|
|
92
|
+
{
|
|
93
|
+
type: "text",
|
|
94
|
+
text: JSON.stringify(result, null, 2),
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
// Build combined markdown output
|
|
100
|
+
let output = "# Project Context\n\n";
|
|
101
|
+
// Group by section (first directory)
|
|
102
|
+
const bySection = {};
|
|
103
|
+
for (const file of files) {
|
|
104
|
+
const section = file.path.split("/")[0] || "root";
|
|
105
|
+
if (!bySection[section]) {
|
|
106
|
+
bySection[section] = [];
|
|
107
|
+
}
|
|
108
|
+
bySection[section].push(file);
|
|
109
|
+
}
|
|
110
|
+
for (const [section, sectionFiles] of Object.entries(bySection)) {
|
|
111
|
+
output += `## ${section}\n\n`;
|
|
112
|
+
for (const file of sectionFiles) {
|
|
113
|
+
output += `### ${file.path}\n\n`;
|
|
114
|
+
output += file.content;
|
|
115
|
+
output += "\n\n---\n\n";
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return {
|
|
119
|
+
content: [
|
|
120
|
+
{
|
|
121
|
+
type: "text",
|
|
122
|
+
text: output,
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
catch (error) {
|
|
128
|
+
return {
|
|
129
|
+
content: [
|
|
130
|
+
{
|
|
131
|
+
type: "text",
|
|
132
|
+
text: `Error reading context: ${error.message}`,
|
|
133
|
+
},
|
|
134
|
+
],
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=read-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-context.js","sourceRoot":"","sources":["../../../src/mcp/tools/read-context.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,CAAC,MAAM,eAAe,GAAS;IACnC,IAAI,EAAE,cAAc;IACpB,WAAW,EACT,gGAAgG;IAClG,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,IAAI,EAAE;gBAC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O,CAAC,GAAG,EAAE,CAAC;YAC1B,CAAC;YACD,SAAS,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAChC,CAAC;QAED,KAAK,MAAM,CAAC,OAAO,EAAE,YAAY,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;YAChE,MAAM,IAAI,MAAM,OAAO,MAAM,CAAC;YAE9B,KAAK,MAAM,IAAI,IAAI,YAAY,EAAE,CAAC;gBAChC,MAAM,IAAI,OAAO,IAAI,CAAC,IAAI,MAAM,CAAC;gBACjC,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC;gBACvB,MAAM,IAAI,aAAa,CAAC;YAC1B,CAAC;QACH,CAAC;QAED,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,MAAM;iBACb;aACF;SACF,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,0BAA2B,KAAe,CAAC,OAAO,EAAE;iBAC3D;aACF;SACF,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import type { McpServerConfig } from "../server.js";
|
|
3
|
+
export declare const syncAllTool: Tool;
|
|
4
|
+
export declare function handleSyncAll(config: McpServerConfig, args: Record<string, unknown>): Promise<{
|
|
5
|
+
content: Array<{
|
|
6
|
+
type: string;
|
|
7
|
+
text: string;
|
|
8
|
+
}>;
|
|
9
|
+
}>;
|
|
10
|
+
//# sourceMappingURL=sync-all.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-all.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/sync-all.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAIpD,eAAO,MAAM,WAAW,EAAE,IAoBzB,CAAC;AAEF,wBAAsB,aAAa,CACjC,MAAM,EAAE,eAAe,EACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAkD7D"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { pullFromCloud } from "../../sync/pull.js";
|
|
2
|
+
import { pushToCloud } from "../../sync/push.js";
|
|
3
|
+
export const syncAllTool = {
|
|
4
|
+
name: "sync_all",
|
|
5
|
+
description: "Synchronize local CONTEXT folder with cloud. Pulls remote changes and pushes local changes.",
|
|
6
|
+
inputSchema: {
|
|
7
|
+
type: "object",
|
|
8
|
+
properties: {
|
|
9
|
+
conflictResolution: {
|
|
10
|
+
type: "string",
|
|
11
|
+
enum: ["timestamp", "local_wins", "remote_wins"],
|
|
12
|
+
default: "timestamp",
|
|
13
|
+
description: "How to resolve conflicts between local and remote",
|
|
14
|
+
},
|
|
15
|
+
dryRun: {
|
|
16
|
+
type: "boolean",
|
|
17
|
+
default: false,
|
|
18
|
+
description: "Preview changes without applying them",
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
export async function handleSyncAll(config, args) {
|
|
24
|
+
const dryRun = args.dryRun ?? false;
|
|
25
|
+
const conflictResolution = args.conflictResolution ?? "timestamp";
|
|
26
|
+
// Pull from cloud first
|
|
27
|
+
const pullResult = await pullFromCloud(config.client, config.contextPath);
|
|
28
|
+
// Then push local changes
|
|
29
|
+
const pushResult = await pushToCloud(config.client, config.contextPath, {
|
|
30
|
+
dryRun,
|
|
31
|
+
conflictResolution: conflictResolution === "local_wins"
|
|
32
|
+
? "folder_wins"
|
|
33
|
+
: conflictResolution === "remote_wins"
|
|
34
|
+
? "timestamp"
|
|
35
|
+
: "timestamp",
|
|
36
|
+
});
|
|
37
|
+
const result = {
|
|
38
|
+
dryRun,
|
|
39
|
+
pull: {
|
|
40
|
+
filesWritten: pullResult.filesWritten,
|
|
41
|
+
filesSkipped: pullResult.filesSkipped,
|
|
42
|
+
},
|
|
43
|
+
push: {
|
|
44
|
+
filesProcessed: pushResult.filesProcessed,
|
|
45
|
+
created: pushResult.result.created,
|
|
46
|
+
updated: pushResult.result.updated,
|
|
47
|
+
skipped: pushResult.result.skipped,
|
|
48
|
+
conflicts: pushResult.result.conflicts.length,
|
|
49
|
+
errors: pushResult.result.errors.length,
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
let summary = `Sync ${dryRun ? "(dry run) " : ""}complete:\n`;
|
|
53
|
+
summary += `- Pulled: ${pullResult.filesWritten} files written\n`;
|
|
54
|
+
summary += `- Pushed: ${pushResult.result.created} created, ${pushResult.result.updated} updated`;
|
|
55
|
+
if (pushResult.result.conflicts.length > 0) {
|
|
56
|
+
summary += `\n- Conflicts: ${pushResult.result.conflicts.length}`;
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
content: [
|
|
60
|
+
{
|
|
61
|
+
type: "text",
|
|
62
|
+
text: summary + "\n\n" + JSON.stringify(result, null, 2),
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=sync-all.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-all.js","sourceRoot":"","sources":["../../../src/mcp/tools/sync-all.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,CAAC,MAAM,WAAW,G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EAAE,UAAU,CAAC,MAAM,CAAC,OAAO;YAClC,OAAO,EAAE,UAAU,CAAC,MAAM,CAAC,OAAO;YAClC,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM;YAC7C,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM;SACxC;KACF,CAAC;IAEF,IAAI,OAAO,GAAG,QAAQ,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC;IAC9D,OAAO,IAAI,aAAa,UAAU,CAAC,YAAY,kBAAkB,CAAC;IAClE,OAAO,IAAI,aAAa,UAAU,CAAC,MAAM,CAAC,OAAO,aAAa,UAAU,CAAC,MAAM,CAAC,OAAO,UAAU,CAAC;IAElG,IAAI,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC3C,OAAO,IAAI,kBAAkB,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;IACpE,CAAC;IAED,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;aACzD;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import type { McpServerConfig } from "../server.js";
|
|
3
|
+
export declare const syncFromAppTool: Tool;
|
|
4
|
+
export declare function handleSyncFromApp(config: McpServerConfig, args: Record<string, unknown>): Promise<{
|
|
5
|
+
content: Array<{
|
|
6
|
+
type: string;
|
|
7
|
+
text: string;
|
|
8
|
+
}>;
|
|
9
|
+
}>;
|
|
10
|
+
//# sourceMappingURL=sync-from-app.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-from-app.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/sync-from-app.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAGpD,eAAO,MAAM,eAAe,EAAE,IAkB7B,CAAC;AAEF,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,eAAe,EACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAsB7D"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { pullFromCloud } from "../../sync/pull.js";
|
|
2
|
+
export const syncFromAppTool = {
|
|
3
|
+
name: "sync_from_app",
|
|
4
|
+
description: "Pull changes from EpicContext cloud to local CONTEXT folder.",
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: "object",
|
|
7
|
+
properties: {
|
|
8
|
+
section: {
|
|
9
|
+
type: "string",
|
|
10
|
+
description: "Section to pull (optional, defaults to all)",
|
|
11
|
+
},
|
|
12
|
+
force: {
|
|
13
|
+
type: "boolean",
|
|
14
|
+
default: false,
|
|
15
|
+
description: "Overwrite local changes without conflict check",
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
export async function handleSyncFromApp(config, args) {
|
|
21
|
+
const section = args.section;
|
|
22
|
+
const force = args.force ?? false;
|
|
23
|
+
const result = await pullFromCloud(config.client, config.contextPath, {
|
|
24
|
+
section,
|
|
25
|
+
force,
|
|
26
|
+
});
|
|
27
|
+
let summary = `Pull complete:\n`;
|
|
28
|
+
summary += `- Total files: ${result.totalFiles}\n`;
|
|
29
|
+
summary += `- Written: ${result.filesWritten}\n`;
|
|
30
|
+
summary += `- Skipped: ${result.filesSkipped}`;
|
|
31
|
+
return {
|
|
32
|
+
content: [
|
|
33
|
+
{
|
|
34
|
+
type: "text",
|
|
35
|
+
text: summary,
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=sync-from-app.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-from-app.js","sourceRoot":"","sources":["../../../src/mcp/tools/sync-from-app.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,MAAM,CAAC,MAAM,eAAe,GAAS;IACnC,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,8DAA8D;IAC3E,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,6CAA6C;aAChD;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,KAAK;gBACd,WAAW,EAAE,gDAAgD;aAC9D;SACF;KACF;CACF,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,MAAuB,EACvB,IAA6B;IAE7B,MAAM,OAAO,GAAG,IAAI,CAAC,OAA6B,CAAC;IACnD,MAAM,KAAK,GAAI,IAAI,CAAC,KAAiB,IAAI,KAAK,CAAC;IAE/C,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,WAAW,EAAE;QACpE,OAAO;QACP,KAAK;KACN,CAAC,CAAC;IAEH,IAAI,OAAO,GAAG,kBAAkB,CAAC;IACjC,OAAO,IAAI,kBAAkB,MAAM,CAAC,UAAU,IAAI,CAAC;IACnD,OAAO,IAAI,cAAc,MAAM,CAAC,YAAY,IAAI,CAAC;IACjD,OAAO,IAAI,cAAc,MAAM,CAAC,YAAY,EAAE,CAAC;IAE/C,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,OAAO;aACd;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import type { McpServerConfig } from "../server.js";
|
|
3
|
+
export declare const syncToAppTool: Tool;
|
|
4
|
+
export declare function handleSyncToApp(config: McpServerConfig, args: Record<string, unknown>): Promise<{
|
|
5
|
+
content: Array<{
|
|
6
|
+
type: string;
|
|
7
|
+
text: string;
|
|
8
|
+
}>;
|
|
9
|
+
}>;
|
|
10
|
+
//# sourceMappingURL=sync-to-app.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-to-app.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/sync-to-app.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAGpD,eAAO,MAAM,aAAa,EAAE,IAkB3B,CAAC;AAEF,wBAAsB,eAAe,CACnC,MAAM,EAAE,eAAe,EACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAqC7D"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { pushToCloud } from "../../sync/push.js";
|
|
2
|
+
export const syncToAppTool = {
|
|
3
|
+
name: "sync_to_app",
|
|
4
|
+
description: "Push local CONTEXT folder changes to EpicContext cloud.",
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: "object",
|
|
7
|
+
properties: {
|
|
8
|
+
path: {
|
|
9
|
+
type: "string",
|
|
10
|
+
description: "Path to specific file or folder to push (optional, defaults to all)",
|
|
11
|
+
},
|
|
12
|
+
force: {
|
|
13
|
+
type: "boolean",
|
|
14
|
+
default: false,
|
|
15
|
+
description: "Overwrite remote changes without conflict check",
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
export async function handleSyncToApp(config, args) {
|
|
21
|
+
const path = args.path;
|
|
22
|
+
const force = args.force ?? false;
|
|
23
|
+
const result = await pushToCloud(config.client, config.contextPath, {
|
|
24
|
+
path,
|
|
25
|
+
conflictResolution: force ? "folder_wins" : "timestamp",
|
|
26
|
+
});
|
|
27
|
+
let summary = `Push complete:\n`;
|
|
28
|
+
summary += `- Files processed: ${result.filesProcessed}\n`;
|
|
29
|
+
summary += `- Created: ${result.result.created}\n`;
|
|
30
|
+
summary += `- Updated: ${result.result.updated}\n`;
|
|
31
|
+
summary += `- Skipped: ${result.result.skipped}`;
|
|
32
|
+
if (result.result.conflicts.length > 0) {
|
|
33
|
+
summary += `\n- Conflicts: ${result.result.conflicts.length}`;
|
|
34
|
+
for (const conflict of result.result.conflicts) {
|
|
35
|
+
summary += `\n - ${conflict.path}`;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
if (result.result.errors.length > 0) {
|
|
39
|
+
summary += `\n- Errors: ${result.result.errors.length}`;
|
|
40
|
+
for (const error of result.result.errors) {
|
|
41
|
+
summary += `\n - ${error.path}: ${error.error}`;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
content: [
|
|
46
|
+
{
|
|
47
|
+
type: "text",
|
|
48
|
+
text: summary,
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=sync-to-app.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-to-app.js","sourceRoot":"","sources":["../../../src/mcp/tools/sync-to-app.ts"],"names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C9D,KAAK,MAAM,QAAQ,IAAI,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;YAC/C,OAAO,IAAI,SAAS,QAAQ,CAAC,IAAI,EAAE,CAAC;QACtC,CAAC;IACH,CAAC;IAED,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpC,OAAO,IAAI,eAAe,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;QACxD,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;YACzC,OAAO,IAAI,SAAS,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,KAAK,EAAE,CAAC;QACnD,CAAC;IACH,CAAC;IAED,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,OAAO;aACd;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import type { McpServerConfig } from "../server.js";
|
|
3
|
+
export declare const updateBlockTool: Tool;
|
|
4
|
+
export declare function handleUpdateBlock(config: McpServerConfig, args: Record<string, unknown>): Promise<{
|
|
5
|
+
content: Array<{
|
|
6
|
+
type: string;
|
|
7
|
+
text: string;
|
|
8
|
+
}>;
|
|
9
|
+
}>;
|
|
10
|
+
//# sourceMappingURL=update-block.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-block.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/update-block.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,eAAO,MAAM,eAAe,EAAE,IA0B7B,CAAC;AAEF,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,eAAe,EACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAiE7D"}
|