@openweave/weave-link 0.2.0 → 0.5.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/auth.d.ts +59 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +130 -0
- package/dist/auth.js.map +1 -0
- package/dist/cli.d.ts +22 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +247 -0
- package/dist/cli.js.map +1 -0
- package/dist/http-transport.d.ts +67 -0
- package/dist/http-transport.d.ts.map +1 -0
- package/dist/http-transport.js +359 -0
- package/dist/http-transport.js.map +1 -0
- package/dist/index.d.ts +14 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +45 -1
- package/dist/index.js.map +1 -1
- package/dist/installer/claude-desktop.d.ts +49 -0
- package/dist/installer/claude-desktop.d.ts.map +1 -0
- package/dist/installer/claude-desktop.js +169 -0
- package/dist/installer/claude-desktop.js.map +1 -0
- package/dist/installer/config-generator.d.ts +47 -0
- package/dist/installer/config-generator.d.ts.map +1 -0
- package/dist/installer/config-generator.js +90 -0
- package/dist/installer/config-generator.js.map +1 -0
- package/dist/installer/cursor.d.ts +52 -0
- package/dist/installer/cursor.d.ts.map +1 -0
- package/dist/installer/cursor.js +165 -0
- package/dist/installer/cursor.js.map +1 -0
- package/dist/installer/index.d.ts +11 -0
- package/dist/installer/index.d.ts.map +1 -0
- package/dist/installer/index.js +14 -0
- package/dist/installer/index.js.map +1 -0
- package/dist/mcp-server.d.ts +75 -0
- package/dist/mcp-server.d.ts.map +1 -0
- package/dist/mcp-server.js +364 -0
- package/dist/mcp-server.js.map +1 -0
- package/dist/tools.d.ts +42 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +230 -0
- package/dist/tools.js.map +1 -0
- package/dist/types.d.ts +86 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +6 -0
- package/dist/types.js.map +1 -0
- package/package.json +2 -3
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Claude Desktop Installer — M8: Client Integrations
|
|
4
|
+
*
|
|
5
|
+
* Locates the Claude Desktop MCP config file on the current OS,
|
|
6
|
+
* reads it, injects the WeaveLink `mcpServers` entry, and writes
|
|
7
|
+
* the result back to disk.
|
|
8
|
+
*
|
|
9
|
+
* Claude Desktop config paths:
|
|
10
|
+
* Windows : %APPDATA%\Claude\claude_desktop_config.json
|
|
11
|
+
* macOS : ~/Library/Application Support/Claude/claude_desktop_config.json
|
|
12
|
+
* Linux : ~/.config/Claude/claude_desktop_config.json
|
|
13
|
+
*/
|
|
14
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
15
|
+
if (k2 === undefined) k2 = k;
|
|
16
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
17
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
18
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
19
|
+
}
|
|
20
|
+
Object.defineProperty(o, k2, desc);
|
|
21
|
+
}) : (function(o, m, k, k2) {
|
|
22
|
+
if (k2 === undefined) k2 = k;
|
|
23
|
+
o[k2] = m[k];
|
|
24
|
+
}));
|
|
25
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
26
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
27
|
+
}) : function(o, v) {
|
|
28
|
+
o["default"] = v;
|
|
29
|
+
});
|
|
30
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
31
|
+
var ownKeys = function(o) {
|
|
32
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
33
|
+
var ar = [];
|
|
34
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
35
|
+
return ar;
|
|
36
|
+
};
|
|
37
|
+
return ownKeys(o);
|
|
38
|
+
};
|
|
39
|
+
return function (mod) {
|
|
40
|
+
if (mod && mod.__esModule) return mod;
|
|
41
|
+
var result = {};
|
|
42
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
43
|
+
__setModuleDefault(result, mod);
|
|
44
|
+
return result;
|
|
45
|
+
};
|
|
46
|
+
})();
|
|
47
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
exports.ClaudeDesktopInstaller = void 0;
|
|
49
|
+
const node_fs_1 = require("node:fs");
|
|
50
|
+
const path = __importStar(require("node:path"));
|
|
51
|
+
const os = __importStar(require("node:os"));
|
|
52
|
+
const config_generator_1 = require("./config-generator");
|
|
53
|
+
// ──────────────────────────────────────────────────────────
|
|
54
|
+
// ClaudeDesktopInstaller
|
|
55
|
+
// ──────────────────────────────────────────────────────────
|
|
56
|
+
class ClaudeDesktopInstaller {
|
|
57
|
+
/**
|
|
58
|
+
* Resolve Claude Desktop's config file path for the current OS.
|
|
59
|
+
*/
|
|
60
|
+
static getConfigPath() {
|
|
61
|
+
const platform = process.platform;
|
|
62
|
+
if (platform === 'win32') {
|
|
63
|
+
const appData = process.env['APPDATA'] ?? path.join(os.homedir(), 'AppData', 'Roaming');
|
|
64
|
+
return path.join(appData, 'Claude', 'claude_desktop_config.json');
|
|
65
|
+
}
|
|
66
|
+
if (platform === 'darwin') {
|
|
67
|
+
return path.join(os.homedir(), 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json');
|
|
68
|
+
}
|
|
69
|
+
// Linux / other
|
|
70
|
+
return path.join(os.homedir(), '.config', 'Claude', 'claude_desktop_config.json');
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Check whether the Claude Desktop config directory exists.
|
|
74
|
+
* Returns `true` if Claude Desktop appears to be installed.
|
|
75
|
+
*/
|
|
76
|
+
static async isInstalled(configPath) {
|
|
77
|
+
const cfgPath = configPath ?? ClaudeDesktopInstaller.getConfigPath();
|
|
78
|
+
try {
|
|
79
|
+
await node_fs_1.promises.access(path.dirname(cfgPath));
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Read the current Claude Desktop config.
|
|
88
|
+
* Returns an empty `{ mcpServers: {} }` structure if the file doesn't exist yet.
|
|
89
|
+
*/
|
|
90
|
+
static async readConfig(configPath) {
|
|
91
|
+
const cfgPath = configPath ?? ClaudeDesktopInstaller.getConfigPath();
|
|
92
|
+
try {
|
|
93
|
+
const raw = await node_fs_1.promises.readFile(cfgPath, 'utf-8');
|
|
94
|
+
return JSON.parse(raw);
|
|
95
|
+
}
|
|
96
|
+
catch {
|
|
97
|
+
return { mcpServers: {} };
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Install (or update) the WeaveLink entry in Claude Desktop's config.
|
|
102
|
+
*
|
|
103
|
+
* @param config Optional WeaveLink connection config.
|
|
104
|
+
* @param mode 'stdio' (default) or 'http'.
|
|
105
|
+
* @param configPath Override the config file path (useful for testing).
|
|
106
|
+
*/
|
|
107
|
+
static async install(config, mode = 'stdio', configPath) {
|
|
108
|
+
const cfgPath = configPath ?? ClaudeDesktopInstaller.getConfigPath();
|
|
109
|
+
try {
|
|
110
|
+
// Ensure the directory exists
|
|
111
|
+
await node_fs_1.promises.mkdir(path.dirname(cfgPath), { recursive: true });
|
|
112
|
+
// Read existing config
|
|
113
|
+
const existing = await ClaudeDesktopInstaller.readConfig(cfgPath);
|
|
114
|
+
// Merge WeaveLink entry
|
|
115
|
+
const updated = config_generator_1.ConfigGenerator.mergeIntoExisting(existing, 'openweave', mode, config);
|
|
116
|
+
const json = config_generator_1.ConfigGenerator.toJSON(updated);
|
|
117
|
+
// Write back
|
|
118
|
+
await node_fs_1.promises.writeFile(cfgPath, json, 'utf-8');
|
|
119
|
+
return {
|
|
120
|
+
success: true,
|
|
121
|
+
configPath: cfgPath,
|
|
122
|
+
message: `WeaveLink MCP entry added to Claude Desktop config.\nRestart Claude Desktop to apply changes.`,
|
|
123
|
+
configWritten: json,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
catch (err) {
|
|
127
|
+
return {
|
|
128
|
+
success: false,
|
|
129
|
+
configPath: cfgPath,
|
|
130
|
+
message: `Failed to install: ${err.message}`,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Remove the WeaveLink entry from Claude Desktop's config.
|
|
136
|
+
*/
|
|
137
|
+
static async uninstall(configPath) {
|
|
138
|
+
const cfgPath = configPath ?? ClaudeDesktopInstaller.getConfigPath();
|
|
139
|
+
try {
|
|
140
|
+
const existing = await ClaudeDesktopInstaller.readConfig(cfgPath);
|
|
141
|
+
if (!existing.mcpServers?.['openweave']) {
|
|
142
|
+
return {
|
|
143
|
+
success: true,
|
|
144
|
+
configPath: cfgPath,
|
|
145
|
+
message: 'WeaveLink entry not found — nothing to remove.',
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
const { ['openweave']: _removed, ...rest } = existing.mcpServers;
|
|
149
|
+
const updated = { ...existing, mcpServers: rest };
|
|
150
|
+
const json = config_generator_1.ConfigGenerator.toJSON(updated);
|
|
151
|
+
await node_fs_1.promises.writeFile(cfgPath, json, 'utf-8');
|
|
152
|
+
return {
|
|
153
|
+
success: true,
|
|
154
|
+
configPath: cfgPath,
|
|
155
|
+
message: 'WeaveLink MCP entry removed from Claude Desktop config.',
|
|
156
|
+
configWritten: json,
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
catch (err) {
|
|
160
|
+
return {
|
|
161
|
+
success: false,
|
|
162
|
+
configPath: cfgPath,
|
|
163
|
+
message: `Failed to uninstall: ${err.message}`,
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
exports.ClaudeDesktopInstaller = ClaudeDesktopInstaller;
|
|
169
|
+
//# sourceMappingURL=claude-desktop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-desktop.js","sourceRoot":"","sources":["../../src/installer/claude-desktop.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,qCAAyC;AACzC,gDAAkC;AAClC,4CAA8B;AAC9B,yDAAwF;AAUxF,6DAA6D;AAC7D,yBAAyB;AACzB,6DAA6D;AAE7D,MAAa,sBAAsB;IACjC;;OAEG;IACH,MAAM,CAAC,aAAa;QAClB,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QAElC,IAAI,QAAQ,KAAK,OAAO,EAAE,CAAC;YACzB,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;YACxF,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,4BAA4B,CAAC,CAAC;QACpE,CAAC;QAED,IAAI,QAAQ,KAAK,QAAQ,EAAE,CAAC;YAC1B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,qBAAqB,EAAE,QAAQ,EAAE,4BAA4B,CAAC,CAAC;QAC3G,CAAC;QAED,gBAAgB;QAChB,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,4BAA4B,CAAC,CAAC;IACpF,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,UAAmB;QAC1C,MAAM,OAAO,GAAG,UAAU,IAAI,sBAAsB,CAAC,aAAa,EAAE,CAAC;QACrE,IAAI,CAAC;YACH,MAAM,kBAAE,CAAC,MAAM,CAAC,IAAI,CAAC,O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EAAE,KAAK;gBACd,UAAU,EAAE,OAAO;gBACnB,OAAO,EAAE,wBAAyB,GAAa,CAAC,OAAO,EAAE;aAC1D,CAAC;QACJ,CAAC;IACH,CAAC;CACF;AAhID,wDAgIC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Config Generator — M8: Client Integrations
|
|
3
|
+
*
|
|
4
|
+
* Generates MCP server configuration objects compatible with
|
|
5
|
+
* Claude Desktop, Cursor, VS Code, and other MCP clients.
|
|
6
|
+
*/
|
|
7
|
+
export interface WeaveLinkConfig {
|
|
8
|
+
host?: string;
|
|
9
|
+
port?: number;
|
|
10
|
+
apiKey?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface MCPClientEntry {
|
|
13
|
+
command: string;
|
|
14
|
+
args: string[];
|
|
15
|
+
env?: Record<string, string>;
|
|
16
|
+
}
|
|
17
|
+
export interface MCPClientsConfig {
|
|
18
|
+
mcpServers: Record<string, MCPClientEntry>;
|
|
19
|
+
}
|
|
20
|
+
export declare class ConfigGenerator {
|
|
21
|
+
/**
|
|
22
|
+
* Generate an MCP stdio-mode entry for a client's config file.
|
|
23
|
+
* This is the standard mode for Claude Desktop and Cursor.
|
|
24
|
+
*
|
|
25
|
+
* The entry runs `weave-link start` via `npx` so no global install is needed.
|
|
26
|
+
*/
|
|
27
|
+
static stdioEntry(config?: WeaveLinkConfig): MCPClientEntry;
|
|
28
|
+
/**
|
|
29
|
+
* Generate an MCP HTTP-mode entry for remote WeaveLink connections.
|
|
30
|
+
*/
|
|
31
|
+
static httpEntry(config?: WeaveLinkConfig): MCPClientEntry;
|
|
32
|
+
/**
|
|
33
|
+
* Build a full `mcpServers` config block, ready to merge into the client's JSON.
|
|
34
|
+
*/
|
|
35
|
+
static buildMCPConfig(serverName?: string, mode?: 'stdio' | 'http', config?: WeaveLinkConfig): MCPClientsConfig;
|
|
36
|
+
/**
|
|
37
|
+
* Format a config object as indented JSON for writing to disk.
|
|
38
|
+
*/
|
|
39
|
+
static toJSON(config: unknown): string;
|
|
40
|
+
/**
|
|
41
|
+
* Deep-merge a WeaveLink entry into an existing client config object.
|
|
42
|
+
* Preserves all existing `mcpServers` entries and only overwrites the
|
|
43
|
+
* `openweave` key.
|
|
44
|
+
*/
|
|
45
|
+
static mergeIntoExisting(existing: MCPClientsConfig, serverName?: string, mode?: 'stdio' | 'http', config?: WeaveLinkConfig): MCPClientsConfig;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=config-generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-generator.d.ts","sourceRoot":"","sources":["../../src/installer/config-generator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9B;AAED,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;CAC5C;AAMD,qBAAa,eAAe;IAC1B;;;;;OAKG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,cAAc;IAoB3D;;OAEG;IACH,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,cAAc;IAkB1D;;OAEG;IACH,MAAM,CAAC,cAAc,CACnB,UAAU,SAAc,EACxB,IAAI,GAAE,OAAO,GAAG,MAAgB,EAChC,MAAM,CAAC,EAAE,eAAe,GACvB,gBAAgB;IAYnB;;OAEG;IACH,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM;IAItC;;;;OAIG;IACH,MAAM,CAAC,iBAAiB,CACtB,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,SAAc,EACxB,IAAI,GAAE,OAAO,GAAG,MAAgB,EAChC,MAAM,CAAC,EAAE,eAAe,GACvB,gBAAgB;CAapB"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Config Generator — M8: Client Integrations
|
|
4
|
+
*
|
|
5
|
+
* Generates MCP server configuration objects compatible with
|
|
6
|
+
* Claude Desktop, Cursor, VS Code, and other MCP clients.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.ConfigGenerator = void 0;
|
|
10
|
+
// ──────────────────────────────────────────────────────────
|
|
11
|
+
// ConfigGenerator
|
|
12
|
+
// ──────────────────────────────────────────────────────────
|
|
13
|
+
class ConfigGenerator {
|
|
14
|
+
/**
|
|
15
|
+
* Generate an MCP stdio-mode entry for a client's config file.
|
|
16
|
+
* This is the standard mode for Claude Desktop and Cursor.
|
|
17
|
+
*
|
|
18
|
+
* The entry runs `weave-link start` via `npx` so no global install is needed.
|
|
19
|
+
*/
|
|
20
|
+
static stdioEntry(config) {
|
|
21
|
+
const args = ['@openweave/weave-link', 'start', '--mode', 'stdio'];
|
|
22
|
+
if (config?.port) {
|
|
23
|
+
args.push('--port', String(config.port));
|
|
24
|
+
}
|
|
25
|
+
const env = {};
|
|
26
|
+
if (config?.apiKey) {
|
|
27
|
+
env['WEAVE_API_KEY'] = config.apiKey;
|
|
28
|
+
}
|
|
29
|
+
const entry = { command: 'npx', args };
|
|
30
|
+
if (Object.keys(env).length > 0) {
|
|
31
|
+
entry.env = env;
|
|
32
|
+
}
|
|
33
|
+
return entry;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Generate an MCP HTTP-mode entry for remote WeaveLink connections.
|
|
37
|
+
*/
|
|
38
|
+
static httpEntry(config) {
|
|
39
|
+
const host = config?.host ?? '127.0.0.1';
|
|
40
|
+
const port = config?.port ?? 3001;
|
|
41
|
+
const args = ['@openweave/weave-link', 'start', '--mode', 'http', '--port', String(port), '--host', host];
|
|
42
|
+
const env = {};
|
|
43
|
+
if (config?.apiKey) {
|
|
44
|
+
env['WEAVE_API_KEY'] = config.apiKey;
|
|
45
|
+
}
|
|
46
|
+
const entry = { command: 'npx', args };
|
|
47
|
+
if (Object.keys(env).length > 0) {
|
|
48
|
+
entry.env = env;
|
|
49
|
+
}
|
|
50
|
+
return entry;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Build a full `mcpServers` config block, ready to merge into the client's JSON.
|
|
54
|
+
*/
|
|
55
|
+
static buildMCPConfig(serverName = 'openweave', mode = 'stdio', config) {
|
|
56
|
+
const entry = mode === 'http'
|
|
57
|
+
? ConfigGenerator.httpEntry(config)
|
|
58
|
+
: ConfigGenerator.stdioEntry(config);
|
|
59
|
+
return {
|
|
60
|
+
mcpServers: {
|
|
61
|
+
[serverName]: entry,
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Format a config object as indented JSON for writing to disk.
|
|
67
|
+
*/
|
|
68
|
+
static toJSON(config) {
|
|
69
|
+
return JSON.stringify(config, null, 2);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Deep-merge a WeaveLink entry into an existing client config object.
|
|
73
|
+
* Preserves all existing `mcpServers` entries and only overwrites the
|
|
74
|
+
* `openweave` key.
|
|
75
|
+
*/
|
|
76
|
+
static mergeIntoExisting(existing, serverName = 'openweave', mode = 'stdio', config) {
|
|
77
|
+
const entry = mode === 'http'
|
|
78
|
+
? ConfigGenerator.httpEntry(config)
|
|
79
|
+
: ConfigGenerator.stdioEntry(config);
|
|
80
|
+
return {
|
|
81
|
+
...existing,
|
|
82
|
+
mcpServers: {
|
|
83
|
+
...(existing.mcpServers ?? {}),
|
|
84
|
+
[serverName]: entry,
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
exports.ConfigGenerator = ConfigGenerator;
|
|
90
|
+
//# sourceMappingURL=config-generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-generator.js","sourceRoot":"","sources":["../../src/installer/config-generator.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAkBH,6DAA6D;AAC7D,kBAAkB;AAClB,6DAA6D;AAE7D,MAAa,eAAe;IAC1B;;;;;OAKG;IACH,MAAM,CAAC,UAAU,CAAC,MAAwB;QACxC,MAAM,IAAI,GAAG,CAAC,uBAAuB,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;QAEnE,IAAI,MAAM,EAAE,IAAI,EAAE,CAAC;YACjB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;QAC3C,CAAC;QAED,MAAM,GAAG,GAA2B,EAAE,CAAC;QACvC,IAAI,MAAM,EAAE,MAAM,EAAE,CAAC;YACnB,GAAG,CAAC,eAAe,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC;QACvC,CAAC;QAED,MAAM,KAAK,GAAmB,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;QACvD,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAChC,KAAK,CAAC,GAAG,GAAG,GAAG,CAAC;QAClB,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,SAAS,CAAC,MAAwB;QACvC,MAAM,IAAI,GAAG,MAAM,EAAE,IAAI,IAAI,WAAW,CAAC;QACzC,MAAM,IAAI,GAAG,MAAM,EAAE,IAAI,IAAI,IAAI,CAAC;QAClC,MAAM,IAAI,GAAG,CAAC,uBAAuB,EAAE,OAAO,EAAE,QAAQ,E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,CAAC;QAEvC,OAAO;YACL,GAAG,QAAQ;YACX,UAAU,EAAE;gBACV,GAAG,CAAC,QAAQ,CAAC,UAAU,IAAI,EAAE,CAAC;gBAC9B,CAAC,UAAU,CAAC,EAAE,KAAK;aACpB;SACF,CAAC;IACJ,CAAC;CACF;AAjGD,0CAiGC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cursor Installer — M8: Client Integrations
|
|
3
|
+
*
|
|
4
|
+
* Generates or updates Cursor's MCP config file.
|
|
5
|
+
*
|
|
6
|
+
* Cursor MCP config path:
|
|
7
|
+
* Global : ~/.cursor/mcp.json
|
|
8
|
+
* Project: <workspaceRoot>/.cursor/mcp.json
|
|
9
|
+
*
|
|
10
|
+
* The project-level config takes priority over the global one.
|
|
11
|
+
*/
|
|
12
|
+
import { MCPClientsConfig, WeaveLinkConfig } from './config-generator';
|
|
13
|
+
export type CursorScope = 'global' | 'project';
|
|
14
|
+
export interface CursorInstallResult {
|
|
15
|
+
success: boolean;
|
|
16
|
+
configPath: string;
|
|
17
|
+
scope: CursorScope;
|
|
18
|
+
message: string;
|
|
19
|
+
configWritten?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare class CursorInstaller {
|
|
22
|
+
/**
|
|
23
|
+
* Resolve the Cursor MCP config path for the given scope.
|
|
24
|
+
*
|
|
25
|
+
* @param scope 'global' (default) or 'project'
|
|
26
|
+
* @param workspaceRoot Required when scope is 'project'
|
|
27
|
+
*/
|
|
28
|
+
static getConfigPath(scope?: CursorScope, workspaceRoot?: string): string;
|
|
29
|
+
/**
|
|
30
|
+
* Read the current Cursor MCP config.
|
|
31
|
+
* Returns `{ mcpServers: {} }` if the file doesn't exist yet.
|
|
32
|
+
*/
|
|
33
|
+
static readConfig(configPath: string): Promise<MCPClientsConfig>;
|
|
34
|
+
/**
|
|
35
|
+
* Install (or update) the WeaveLink entry in Cursor's MCP config.
|
|
36
|
+
*
|
|
37
|
+
* @param scope 'global' (default) or 'project'
|
|
38
|
+
* @param workspaceRoot Path to workspace root (required for project scope)
|
|
39
|
+
* @param config Optional WeaveLink connection config
|
|
40
|
+
* @param mode 'stdio' (default) or 'http'
|
|
41
|
+
*/
|
|
42
|
+
static install(scope?: CursorScope, workspaceRoot?: string, config?: WeaveLinkConfig, mode?: 'stdio' | 'http'): Promise<CursorInstallResult>;
|
|
43
|
+
/**
|
|
44
|
+
* Remove the WeaveLink entry from Cursor's MCP config.
|
|
45
|
+
*/
|
|
46
|
+
static uninstall(scope?: CursorScope, workspaceRoot?: string): Promise<CursorInstallResult>;
|
|
47
|
+
/**
|
|
48
|
+
* Check if Cursor is installed by looking for the ~/.cursor directory.
|
|
49
|
+
*/
|
|
50
|
+
static isInstalled(): Promise<boolean>;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=cursor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cursor.d.ts","sourceRoot":"","sources":["../../src/installer/cursor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,OAAO,EAAmB,gBAAgB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAExF,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE/C,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,WAAW,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAMD,qBAAa,eAAe;IAC1B;;;;;OAKG;IACH,MAAM,CAAC,aAAa,CAAC,KAAK,GAAE,WAAsB,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM;IAQnF;;;OAGG;WACU,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAStE;;;;;;;OAOG;WACU,OAAO,CAClB,KAAK,GAAE,WAAsB,EAC7B,aAAa,CAAC,EAAE,MAAM,EACtB,MAAM,CAAC,EAAE,eAAe,EACxB,IAAI,GAAE,OAAO,GAAG,MAAgB,GAC/B,OAAO,CAAC,mBAAmB,CAAC;IA6B/B;;OAEG;WACU,SAAS,CACpB,KAAK,GAAE,WAAsB,EAC7B,aAAa,CAAC,EAAE,MAAM,GACrB,OAAO,CAAC,mBAAmB,CAAC;IAsC/B;;OAEG;WACU,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;CAQ7C"}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Cursor Installer — M8: Client Integrations
|
|
4
|
+
*
|
|
5
|
+
* Generates or updates Cursor's MCP config file.
|
|
6
|
+
*
|
|
7
|
+
* Cursor MCP config path:
|
|
8
|
+
* Global : ~/.cursor/mcp.json
|
|
9
|
+
* Project: <workspaceRoot>/.cursor/mcp.json
|
|
10
|
+
*
|
|
11
|
+
* The project-level config takes priority over the global one.
|
|
12
|
+
*/
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
30
|
+
var ownKeys = function(o) {
|
|
31
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
32
|
+
var ar = [];
|
|
33
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
34
|
+
return ar;
|
|
35
|
+
};
|
|
36
|
+
return ownKeys(o);
|
|
37
|
+
};
|
|
38
|
+
return function (mod) {
|
|
39
|
+
if (mod && mod.__esModule) return mod;
|
|
40
|
+
var result = {};
|
|
41
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
42
|
+
__setModuleDefault(result, mod);
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
})();
|
|
46
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
|
+
exports.CursorInstaller = void 0;
|
|
48
|
+
const node_fs_1 = require("node:fs");
|
|
49
|
+
const path = __importStar(require("node:path"));
|
|
50
|
+
const os = __importStar(require("node:os"));
|
|
51
|
+
const config_generator_1 = require("./config-generator");
|
|
52
|
+
// ──────────────────────────────────────────────────────────
|
|
53
|
+
// CursorInstaller
|
|
54
|
+
// ──────────────────────────────────────────────────────────
|
|
55
|
+
class CursorInstaller {
|
|
56
|
+
/**
|
|
57
|
+
* Resolve the Cursor MCP config path for the given scope.
|
|
58
|
+
*
|
|
59
|
+
* @param scope 'global' (default) or 'project'
|
|
60
|
+
* @param workspaceRoot Required when scope is 'project'
|
|
61
|
+
*/
|
|
62
|
+
static getConfigPath(scope = 'global', workspaceRoot) {
|
|
63
|
+
if (scope === 'project') {
|
|
64
|
+
const root = workspaceRoot ?? process.cwd();
|
|
65
|
+
return path.join(root, '.cursor', 'mcp.json');
|
|
66
|
+
}
|
|
67
|
+
return path.join(os.homedir(), '.cursor', 'mcp.json');
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Read the current Cursor MCP config.
|
|
71
|
+
* Returns `{ mcpServers: {} }` if the file doesn't exist yet.
|
|
72
|
+
*/
|
|
73
|
+
static async readConfig(configPath) {
|
|
74
|
+
try {
|
|
75
|
+
const raw = await node_fs_1.promises.readFile(configPath, 'utf-8');
|
|
76
|
+
return JSON.parse(raw);
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
return { mcpServers: {} };
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Install (or update) the WeaveLink entry in Cursor's MCP config.
|
|
84
|
+
*
|
|
85
|
+
* @param scope 'global' (default) or 'project'
|
|
86
|
+
* @param workspaceRoot Path to workspace root (required for project scope)
|
|
87
|
+
* @param config Optional WeaveLink connection config
|
|
88
|
+
* @param mode 'stdio' (default) or 'http'
|
|
89
|
+
*/
|
|
90
|
+
static async install(scope = 'global', workspaceRoot, config, mode = 'stdio') {
|
|
91
|
+
const cfgPath = CursorInstaller.getConfigPath(scope, workspaceRoot);
|
|
92
|
+
try {
|
|
93
|
+
await node_fs_1.promises.mkdir(path.dirname(cfgPath), { recursive: true });
|
|
94
|
+
const existing = await CursorInstaller.readConfig(cfgPath);
|
|
95
|
+
const updated = config_generator_1.ConfigGenerator.mergeIntoExisting(existing, 'openweave', mode, config);
|
|
96
|
+
const json = config_generator_1.ConfigGenerator.toJSON(updated);
|
|
97
|
+
await node_fs_1.promises.writeFile(cfgPath, json, 'utf-8');
|
|
98
|
+
return {
|
|
99
|
+
success: true,
|
|
100
|
+
configPath: cfgPath,
|
|
101
|
+
scope,
|
|
102
|
+
message: `WeaveLink MCP entry added to Cursor ${scope} config.\nRestart Cursor to apply changes.`,
|
|
103
|
+
configWritten: json,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
catch (err) {
|
|
107
|
+
return {
|
|
108
|
+
success: false,
|
|
109
|
+
configPath: cfgPath,
|
|
110
|
+
scope,
|
|
111
|
+
message: `Failed to install: ${err.message}`,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Remove the WeaveLink entry from Cursor's MCP config.
|
|
117
|
+
*/
|
|
118
|
+
static async uninstall(scope = 'global', workspaceRoot) {
|
|
119
|
+
const cfgPath = CursorInstaller.getConfigPath(scope, workspaceRoot);
|
|
120
|
+
try {
|
|
121
|
+
const existing = await CursorInstaller.readConfig(cfgPath);
|
|
122
|
+
if (!existing.mcpServers?.['openweave']) {
|
|
123
|
+
return {
|
|
124
|
+
success: true,
|
|
125
|
+
configPath: cfgPath,
|
|
126
|
+
scope,
|
|
127
|
+
message: 'WeaveLink entry not found — nothing to remove.',
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
const { ['openweave']: _removed, ...rest } = existing.mcpServers;
|
|
131
|
+
const updated = { ...existing, mcpServers: rest };
|
|
132
|
+
const json = config_generator_1.ConfigGenerator.toJSON(updated);
|
|
133
|
+
await node_fs_1.promises.writeFile(cfgPath, json, 'utf-8');
|
|
134
|
+
return {
|
|
135
|
+
success: true,
|
|
136
|
+
configPath: cfgPath,
|
|
137
|
+
scope,
|
|
138
|
+
message: `WeaveLink MCP entry removed from Cursor ${scope} config.`,
|
|
139
|
+
configWritten: json,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
catch (err) {
|
|
143
|
+
return {
|
|
144
|
+
success: false,
|
|
145
|
+
configPath: cfgPath,
|
|
146
|
+
scope,
|
|
147
|
+
message: `Failed to uninstall: ${err.message}`,
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Check if Cursor is installed by looking for the ~/.cursor directory.
|
|
153
|
+
*/
|
|
154
|
+
static async isInstalled() {
|
|
155
|
+
try {
|
|
156
|
+
await node_fs_1.promises.access(path.join(os.homedir(), '.cursor'));
|
|
157
|
+
return true;
|
|
158
|
+
}
|
|
159
|
+
catch {
|
|
160
|
+
return false;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
exports.CursorInstaller = CursorInsta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OAAO,EAAE,gDAAgD;iBAC1D,CAAC;YACJ,CAAC;YAED,MAAM,EAAE,CAAC,WAAW,CAAC,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,GAAG,QAAQ,CAAC,UAAU,CAAC;YACjE,MAAM,OAAO,GAAqB,EAAE,GAAG,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;YACpE,MAAM,IAAI,GAAG,kCAAe,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAE7C,MAAM,kBAAE,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;YAE3C,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,UAAU,EAAE,OAAO;gBACnB,KAAK;gBACL,OAAO,EAAE,2CAA2C,KAAK,UAAU;gBACnE,aAAa,EAAE,IAAI;aACpB,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,UAAU,EAAE,OAAO;gBACnB,KAAK;gBACL,OAAO,EAAE,wBAAyB,GAAa,CAAC,OAAO,EAAE;aAC1D,CAAC;QACJ,CAAC;IACH,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,WAAW;QACtB,IAAI,CAAC;YACH,MAAM,kBAAE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,CAAC,CAAC,CAAC;YACpD,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;CACF;AA7HD,0CA6HC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Installer — M8: Client Integrations
|
|
3
|
+
* Exports all client installers
|
|
4
|
+
*/
|
|
5
|
+
export type { WeaveLinkConfig, MCPClientEntry, MCPClientsConfig } from './config-generator';
|
|
6
|
+
export { ConfigGenerator } from './config-generator';
|
|
7
|
+
export type { InstallResult } from './claude-desktop';
|
|
8
|
+
export { ClaudeDesktopInstaller } from './claude-desktop';
|
|
9
|
+
export type { CursorInstallResult, CursorScope } from './cursor';
|
|
10
|
+
export { CursorInstaller } from './cursor';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/installer/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC5F,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,YAAY,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Installer — M8: Client Integrations
|
|
4
|
+
* Exports all client installers
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.CursorInstaller = exports.ClaudeDesktopInstaller = exports.ConfigGenerator = void 0;
|
|
8
|
+
var config_generator_1 = require("./config-generator");
|
|
9
|
+
Object.defineProperty(exports, "ConfigGenerator", { enumerable: true, get: function () { return config_generator_1.ConfigGenerator; } });
|
|
10
|
+
var claude_desktop_1 = require("./claude-desktop");
|
|
11
|
+
Object.defineProperty(exports, "ClaudeDesktopInstaller", { enumerable: true, get: function () { return claude_desktop_1.ClaudeDesktopInstaller; } });
|
|
12
|
+
var cursor_1 = require("./cursor");
|
|
13
|
+
Object.defineProperty(exports, "CursorInstaller", { enumerable: true, get: function () { return cursor_1.CursorInstaller; } });
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/installer/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,uDAAqD;AAA5C,mHAAA,eAAe,OAAA;AAGxB,mDAA0D;AAAjD,wHAAA,sBAAsB,OAAA;AAG/B,mCAA2C;AAAlC,yGAAA,eAAe,OAAA"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { MCPServerConfig, MCPResponse, MCPTool } from "./types";
|
|
2
|
+
export declare class WeaveLinkServer {
|
|
3
|
+
private config;
|
|
4
|
+
private sessions;
|
|
5
|
+
constructor(config?: MCPServerConfig);
|
|
6
|
+
/**
|
|
7
|
+
* Initialize server (setup, load state, etc.)
|
|
8
|
+
*/
|
|
9
|
+
initialize(): Promise<void>;
|
|
10
|
+
/**
|
|
11
|
+
* List available tools
|
|
12
|
+
*/
|
|
13
|
+
listTools(): MCPTool[];
|
|
14
|
+
/**
|
|
15
|
+
* Get tool by name
|
|
16
|
+
*/
|
|
17
|
+
getTool(name: string): MCPTool | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Handle tool call
|
|
20
|
+
*/
|
|
21
|
+
callTool(toolName: string, args: Record<string, unknown>): Promise<MCPResponse<unknown>>;
|
|
22
|
+
/**
|
|
23
|
+
* Handler: save_node
|
|
24
|
+
*/
|
|
25
|
+
private handleSaveNode;
|
|
26
|
+
/**
|
|
27
|
+
* Handler: query_graph
|
|
28
|
+
*/
|
|
29
|
+
private handleQueryGraph;
|
|
30
|
+
/**
|
|
31
|
+
* Handler: suppress_error
|
|
32
|
+
*/
|
|
33
|
+
private handleSuppressError;
|
|
34
|
+
/**
|
|
35
|
+
* Handler: update_roadmap
|
|
36
|
+
*/
|
|
37
|
+
private handleUpdateRoadmap;
|
|
38
|
+
/**
|
|
39
|
+
* Handler: get_session_context
|
|
40
|
+
*/
|
|
41
|
+
private handleGetSessionContext;
|
|
42
|
+
/**
|
|
43
|
+
* Handler: get_next_action
|
|
44
|
+
*/
|
|
45
|
+
private handleGetNextAction;
|
|
46
|
+
/**
|
|
47
|
+
* Handler: list_orphans
|
|
48
|
+
*/
|
|
49
|
+
private handleListOrphans;
|
|
50
|
+
/**
|
|
51
|
+
* Helper: get or create session
|
|
52
|
+
*/
|
|
53
|
+
private getOrCreateSession;
|
|
54
|
+
/**
|
|
55
|
+
* Helper: success response
|
|
56
|
+
*/
|
|
57
|
+
private success;
|
|
58
|
+
/**
|
|
59
|
+
* Helper: error response
|
|
60
|
+
*/
|
|
61
|
+
private error;
|
|
62
|
+
/**
|
|
63
|
+
* Get server info
|
|
64
|
+
*/
|
|
65
|
+
getServerInfo(): {
|
|
66
|
+
name: string | undefined;
|
|
67
|
+
version: string | undefined;
|
|
68
|
+
description: string | undefined;
|
|
69
|
+
tools: {
|
|
70
|
+
name: string;
|
|
71
|
+
description: string;
|
|
72
|
+
}[];
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=mcp-server.d.ts.map
|