@beeper/desktop-mcp 4.2.3 → 4.6.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/LICENSE +1 -1
- package/README.md +18 -199
- package/auth.d.mts +6 -0
- package/auth.d.mts.map +1 -0
- package/auth.d.ts +6 -0
- package/auth.d.ts.map +1 -0
- package/auth.js +37 -0
- package/auth.js.map +1 -0
- package/auth.mjs +32 -0
- package/auth.mjs.map +1 -0
- package/code-tool-types.d.mts +7 -7
- package/code-tool-types.d.mts.map +1 -1
- package/code-tool-types.d.ts +7 -7
- package/code-tool-types.d.ts.map +1 -1
- package/code-tool-worker.d.mts.map +1 -1
- package/code-tool-worker.d.ts.map +1 -1
- package/code-tool-worker.js +103 -19
- package/code-tool-worker.js.map +1 -1
- package/code-tool-worker.mjs +103 -19
- package/code-tool-worker.mjs.map +1 -1
- package/code-tool.d.mts +12 -3
- package/code-tool.d.mts.map +1 -1
- package/code-tool.d.ts +12 -3
- package/code-tool.d.ts.map +1 -1
- package/code-tool.js +276 -95
- package/code-tool.js.map +1 -1
- package/code-tool.mjs +273 -95
- package/code-tool.mjs.map +1 -1
- package/http.d.mts +6 -9
- package/http.d.mts.map +1 -1
- package/http.d.ts +6 -9
- package/http.d.ts.map +1 -1
- package/http.js +81 -47
- package/http.js.map +1 -1
- package/http.mjs +80 -43
- package/http.mjs.map +1 -1
- package/index.js +19 -50
- package/index.js.map +1 -1
- package/index.mjs +19 -50
- package/index.mjs.map +1 -1
- package/instructions.d.mts +2 -0
- package/instructions.d.mts.map +1 -0
- package/instructions.d.ts +2 -0
- package/instructions.d.ts.map +1 -0
- package/instructions.js +48 -0
- package/instructions.js.map +1 -0
- package/instructions.mjs +45 -0
- package/instructions.mjs.map +1 -0
- package/logger.d.mts +7 -0
- package/logger.d.mts.map +1 -0
- package/logger.d.ts +7 -0
- package/logger.d.ts.map +1 -0
- package/logger.js +29 -0
- package/logger.js.map +1 -0
- package/logger.mjs +22 -0
- package/logger.mjs.map +1 -0
- package/methods.d.mts +10 -0
- package/methods.d.mts.map +1 -0
- package/methods.d.ts +10 -0
- package/methods.d.ts.map +1 -0
- package/methods.js +203 -0
- package/methods.js.map +1 -0
- package/methods.mjs +199 -0
- package/methods.mjs.map +1 -0
- package/options.d.mts +9 -10
- package/options.d.mts.map +1 -1
- package/options.d.ts +9 -10
- package/options.d.ts.map +1 -1
- package/options.js +52 -363
- package/options.js.map +1 -1
- package/options.mjs +52 -363
- package/options.mjs.map +1 -1
- package/package.json +68 -82
- package/server.d.mts +10 -16
- package/server.d.mts.map +1 -1
- package/server.d.ts +10 -16
- package/server.d.ts.map +1 -1
- package/server.js +82 -105
- package/server.js.map +1 -1
- package/server.mjs +81 -100
- package/server.mjs.map +1 -1
- package/src/auth.ts +42 -0
- package/src/code-tool-types.ts +8 -5
- package/src/code-tool-worker.ts +118 -34
- package/src/code-tool.ts +359 -118
- package/src/http.ts +99 -50
- package/src/index.ts +22 -63
- package/src/instructions.ts +67 -0
- package/src/logger.ts +28 -0
- package/src/methods.ts +224 -0
- package/src/options.ts +69 -390
- package/src/server.ts +95 -121
- package/src/stdio.ts +6 -5
- package/src/{tools/types.ts → types.ts} +25 -5
- package/src/util.ts +25 -0
- package/stdio.d.mts +1 -1
- package/stdio.d.mts.map +1 -1
- package/stdio.d.ts +1 -1
- package/stdio.d.ts.map +1 -1
- package/stdio.js +5 -4
- package/stdio.js.map +1 -1
- package/stdio.mjs +5 -4
- package/stdio.mjs.map +1 -1
- package/{tools/types.d.mts → types.d.mts} +10 -2
- package/types.d.mts.map +1 -0
- package/{tools/types.d.ts → types.d.ts} +10 -2
- package/types.d.ts.map +1 -0
- package/{tools/types.js → types.js} +12 -0
- package/types.js.map +1 -0
- package/{tools/types.mjs → types.mjs} +11 -0
- package/types.mjs.map +1 -0
- package/util.d.mts +4 -0
- package/util.d.mts.map +1 -0
- package/util.d.ts +4 -0
- package/util.d.ts.map +1 -0
- package/util.js +30 -0
- package/util.js.map +1 -0
- package/util.mjs +24 -0
- package/util.mjs.map +1 -0
- package/compat.d.mts +0 -58
- package/compat.d.mts.map +0 -1
- package/compat.d.ts +0 -58
- package/compat.d.ts.map +0 -1
- package/compat.js +0 -387
- package/compat.js.map +0 -1
- package/compat.mjs +0 -378
- package/compat.mjs.map +0 -1
- package/docs-search-tool.d.mts +0 -44
- package/docs-search-tool.d.mts.map +0 -1
- package/docs-search-tool.d.ts +0 -44
- package/docs-search-tool.d.ts.map +0 -1
- package/docs-search-tool.js +0 -43
- package/docs-search-tool.js.map +0 -1
- package/docs-search-tool.mjs +0 -39
- package/docs-search-tool.mjs.map +0 -1
- package/dynamic-tools.d.mts +0 -12
- package/dynamic-tools.d.mts.map +0 -1
- package/dynamic-tools.d.ts +0 -12
- package/dynamic-tools.d.ts.map +0 -1
- package/dynamic-tools.js +0 -135
- package/dynamic-tools.js.map +0 -1
- package/dynamic-tools.mjs +0 -132
- package/dynamic-tools.mjs.map +0 -1
- package/filtering.d.mts +0 -2
- package/filtering.d.mts.map +0 -1
- package/filtering.d.ts +0 -2
- package/filtering.d.ts.map +0 -1
- package/filtering.js +0 -20
- package/filtering.js.map +0 -1
- package/filtering.mjs +0 -13
- package/filtering.mjs.map +0 -1
- package/handlers/get-accounts.d.mts +0 -3
- package/handlers/get-accounts.d.mts.map +0 -1
- package/handlers/get-accounts.d.ts +0 -3
- package/handlers/get-accounts.d.ts.map +0 -1
- package/handlers/get-accounts.js +0 -32
- package/handlers/get-accounts.js.map +0 -1
- package/handlers/get-accounts.mjs +0 -28
- package/handlers/get-accounts.mjs.map +0 -1
- package/handlers/get-chat.d.mts +0 -3
- package/handlers/get-chat.d.mts.map +0 -1
- package/handlers/get-chat.d.ts +0 -3
- package/handlers/get-chat.d.ts.map +0 -1
- package/handlers/get-chat.js +0 -20
- package/handlers/get-chat.js.map +0 -1
- package/handlers/get-chat.mjs +0 -16
- package/handlers/get-chat.mjs.map +0 -1
- package/handlers/index.d.mts +0 -3
- package/handlers/index.d.mts.map +0 -1
- package/handlers/index.d.ts +0 -3
- package/handlers/index.d.ts.map +0 -1
- package/handlers/index.js +0 -30
- package/handlers/index.js.map +0 -1
- package/handlers/index.mjs +0 -27
- package/handlers/index.mjs.map +0 -1
- package/handlers/list-chats.d.mts +0 -3
- package/handlers/list-chats.d.mts.map +0 -1
- package/handlers/list-chats.d.ts +0 -3
- package/handlers/list-chats.d.ts.map +0 -1
- package/handlers/list-chats.js +0 -46
- package/handlers/list-chats.js.map +0 -1
- package/handlers/list-chats.mjs +0 -42
- package/handlers/list-chats.mjs.map +0 -1
- package/handlers/list-messages.d.mts +0 -3
- package/handlers/list-messages.d.mts.map +0 -1
- package/handlers/list-messages.d.ts +0 -3
- package/handlers/list-messages.d.ts.map +0 -1
- package/handlers/list-messages.js +0 -34
- package/handlers/list-messages.js.map +0 -1
- package/handlers/list-messages.mjs +0 -30
- package/handlers/list-messages.mjs.map +0 -1
- package/handlers/open-app.d.mts +0 -3
- package/handlers/open-app.d.mts.map +0 -1
- package/handlers/open-app.d.ts +0 -3
- package/handlers/open-app.d.ts.map +0 -1
- package/handlers/open-app.js +0 -26
- package/handlers/open-app.js.map +0 -1
- package/handlers/open-app.mjs +0 -22
- package/handlers/open-app.mjs.map +0 -1
- package/handlers/search-chats.d.mts +0 -3
- package/handlers/search-chats.d.mts.map +0 -1
- package/handlers/search-chats.d.ts +0 -3
- package/handlers/search-chats.d.ts.map +0 -1
- package/handlers/search-chats.js +0 -38
- package/handlers/search-chats.js.map +0 -1
- package/handlers/search-chats.mjs +0 -34
- package/handlers/search-chats.mjs.map +0 -1
- package/handlers/search-messages.d.mts +0 -3
- package/handlers/search-messages.d.mts.map +0 -1
- package/handlers/search-messages.d.ts +0 -3
- package/handlers/search-messages.d.ts.map +0 -1
- package/handlers/search-messages.js +0 -11
- package/handlers/search-messages.js.map +0 -1
- package/handlers/search-messages.mjs +0 -7
- package/handlers/search-messages.mjs.map +0 -1
- package/handlers/search.d.mts +0 -3
- package/handlers/search.d.mts.map +0 -1
- package/handlers/search.d.ts +0 -3
- package/handlers/search.d.ts.map +0 -1
- package/handlers/search.js +0 -29
- package/handlers/search.js.map +0 -1
- package/handlers/search.mjs +0 -25
- package/handlers/search.mjs.map +0 -1
- package/handlers/send-message.d.mts +0 -3
- package/handlers/send-message.d.mts.map +0 -1
- package/handlers/send-message.d.ts +0 -3
- package/handlers/send-message.d.ts.map +0 -1
- package/handlers/send-message.js +0 -20
- package/handlers/send-message.js.map +0 -1
- package/handlers/send-message.mjs +0 -16
- package/handlers/send-message.mjs.map +0 -1
- package/handlers/utils.d.mts +0 -29
- package/handlers/utils.d.mts.map +0 -1
- package/handlers/utils.d.ts +0 -29
- package/handlers/utils.d.ts.map +0 -1
- package/handlers/utils.js +0 -296
- package/handlers/utils.js.map +0 -1
- package/handlers/utils.mjs +0 -282
- package/handlers/utils.mjs.map +0 -1
- package/headers.d.mts +0 -4
- package/headers.d.mts.map +0 -1
- package/headers.d.ts +0 -4
- package/headers.d.ts.map +0 -1
- package/headers.js +0 -22
- package/headers.js.map +0 -1
- package/headers.mjs +0 -18
- package/headers.mjs.map +0 -1
- package/src/compat.ts +0 -483
- package/src/docs-search-tool.ts +0 -48
- package/src/dynamic-tools.ts +0 -159
- package/src/filtering.ts +0 -14
- package/src/handlers/get-accounts.ts +0 -28
- package/src/handlers/get-chat.ts +0 -18
- package/src/handlers/index.ts +0 -29
- package/src/handlers/list-chats.ts +0 -47
- package/src/handlers/list-messages.ts +0 -33
- package/src/handlers/open-app.ts +0 -20
- package/src/handlers/search-chats.ts +0 -39
- package/src/handlers/search-messages.ts +0 -8
- package/src/handlers/search.ts +0 -24
- package/src/handlers/send-message.ts +0 -17
- package/src/handlers/utils.ts +0 -381
- package/src/headers.ts +0 -23
- package/src/tools/accounts/get-accounts.ts +0 -34
- package/src/tools/chats/archive-chat.ts +0 -43
- package/src/tools/chats/get-chat.ts +0 -45
- package/src/tools/chats/reminders/clear-chat-reminder.ts +0 -41
- package/src/tools/chats/reminders/set-chat-reminder.ts +0 -54
- package/src/tools/chats/search-chats.ts +0 -104
- package/src/tools/index.ts +0 -92
- package/src/tools/messages/list-messages.ts +0 -51
- package/src/tools/messages/search-messages.ts +0 -123
- package/src/tools/messages/send-message.ts +0 -47
- package/src/tools/top-level/focus-app.ts +0 -52
- package/src/tools/top-level/search.ts +0 -41
- package/src/tools.ts +0 -1
- package/tools/accounts/get-accounts.d.mts +0 -45
- package/tools/accounts/get-accounts.d.mts.map +0 -1
- package/tools/accounts/get-accounts.d.ts +0 -45
- package/tools/accounts/get-accounts.d.ts.map +0 -1
- package/tools/accounts/get-accounts.js +0 -31
- package/tools/accounts/get-accounts.js.map +0 -1
- package/tools/accounts/get-accounts.mjs +0 -27
- package/tools/accounts/get-accounts.mjs.map +0 -1
- package/tools/chats/archive-chat.d.mts +0 -45
- package/tools/chats/archive-chat.d.mts.map +0 -1
- package/tools/chats/archive-chat.d.ts +0 -45
- package/tools/chats/archive-chat.d.ts.map +0 -1
- package/tools/chats/archive-chat.js +0 -40
- package/tools/chats/archive-chat.js.map +0 -1
- package/tools/chats/archive-chat.mjs +0 -36
- package/tools/chats/archive-chat.mjs.map +0 -1
- package/tools/chats/get-chat.d.mts +0 -45
- package/tools/chats/get-chat.d.mts.map +0 -1
- package/tools/chats/get-chat.d.ts +0 -45
- package/tools/chats/get-chat.d.ts.map +0 -1
- package/tools/chats/get-chat.js +0 -41
- package/tools/chats/get-chat.js.map +0 -1
- package/tools/chats/get-chat.mjs +0 -37
- package/tools/chats/get-chat.mjs.map +0 -1
- package/tools/chats/reminders/clear-chat-reminder.d.mts +0 -45
- package/tools/chats/reminders/clear-chat-reminder.d.mts.map +0 -1
- package/tools/chats/reminders/clear-chat-reminder.d.ts +0 -45
- package/tools/chats/reminders/clear-chat-reminder.d.ts.map +0 -1
- package/tools/chats/reminders/clear-chat-reminder.js +0 -38
- package/tools/chats/reminders/clear-chat-reminder.js.map +0 -1
- package/tools/chats/reminders/clear-chat-reminder.mjs +0 -34
- package/tools/chats/reminders/clear-chat-reminder.mjs.map +0 -1
- package/tools/chats/reminders/set-chat-reminder.d.mts +0 -45
- package/tools/chats/reminders/set-chat-reminder.d.mts.map +0 -1
- package/tools/chats/reminders/set-chat-reminder.d.ts +0 -45
- package/tools/chats/reminders/set-chat-reminder.d.ts.map +0 -1
- package/tools/chats/reminders/set-chat-reminder.js +0 -51
- package/tools/chats/reminders/set-chat-reminder.js.map +0 -1
- package/tools/chats/reminders/set-chat-reminder.mjs +0 -47
- package/tools/chats/reminders/set-chat-reminder.mjs.map +0 -1
- package/tools/chats/search-chats.d.mts +0 -45
- package/tools/chats/search-chats.d.mts.map +0 -1
- package/tools/chats/search-chats.d.ts +0 -45
- package/tools/chats/search-chats.d.ts.map +0 -1
- package/tools/chats/search-chats.js +0 -92
- package/tools/chats/search-chats.js.map +0 -1
- package/tools/chats/search-chats.mjs +0 -88
- package/tools/chats/search-chats.mjs.map +0 -1
- package/tools/index.d.mts +0 -10
- package/tools/index.d.mts.map +0 -1
- package/tools/index.d.ts +0 -10
- package/tools/index.d.ts.map +0 -1
- package/tools/index.js +0 -76
- package/tools/index.js.map +0 -1
- package/tools/index.mjs +0 -69
- package/tools/index.mjs.map +0 -1
- package/tools/messages/list-messages.d.mts +0 -45
- package/tools/messages/list-messages.d.mts.map +0 -1
- package/tools/messages/list-messages.d.ts +0 -45
- package/tools/messages/list-messages.d.ts.map +0 -1
- package/tools/messages/list-messages.js +0 -47
- package/tools/messages/list-messages.js.map +0 -1
- package/tools/messages/list-messages.mjs +0 -43
- package/tools/messages/list-messages.mjs.map +0 -1
- package/tools/messages/search-messages.d.mts +0 -45
- package/tools/messages/search-messages.d.mts.map +0 -1
- package/tools/messages/search-messages.d.ts +0 -45
- package/tools/messages/search-messages.d.ts.map +0 -1
- package/tools/messages/search-messages.js +0 -110
- package/tools/messages/search-messages.js.map +0 -1
- package/tools/messages/search-messages.mjs +0 -106
- package/tools/messages/search-messages.mjs.map +0 -1
- package/tools/messages/send-message.d.mts +0 -45
- package/tools/messages/send-message.d.mts.map +0 -1
- package/tools/messages/send-message.d.ts +0 -45
- package/tools/messages/send-message.d.ts.map +0 -1
- package/tools/messages/send-message.js +0 -43
- package/tools/messages/send-message.js.map +0 -1
- package/tools/messages/send-message.mjs +0 -39
- package/tools/messages/send-message.mjs.map +0 -1
- package/tools/top-level/focus-app.d.mts +0 -45
- package/tools/top-level/focus-app.d.mts.map +0 -1
- package/tools/top-level/focus-app.d.ts +0 -45
- package/tools/top-level/focus-app.d.ts.map +0 -1
- package/tools/top-level/focus-app.js +0 -47
- package/tools/top-level/focus-app.js.map +0 -1
- package/tools/top-level/focus-app.mjs +0 -43
- package/tools/top-level/focus-app.mjs.map +0 -1
- package/tools/top-level/search.d.mts +0 -45
- package/tools/top-level/search.d.mts.map +0 -1
- package/tools/top-level/search.d.ts +0 -45
- package/tools/top-level/search.d.ts.map +0 -1
- package/tools/top-level/search.js +0 -37
- package/tools/top-level/search.js.map +0 -1
- package/tools/top-level/search.mjs +0 -33
- package/tools/top-level/search.mjs.map +0 -1
- package/tools/types.d.mts.map +0 -1
- package/tools/types.d.ts.map +0 -1
- package/tools/types.js.map +0 -1
- package/tools/types.mjs.map +0 -1
- package/tools.d.mts +0 -2
- package/tools.d.mts.map +0 -1
- package/tools.d.ts +0 -2
- package/tools.d.ts.map +0 -1
- package/tools.js +0 -18
- package/tools.js.map +0 -1
- package/tools.mjs +0 -2
- package/tools.mjs.map +0 -1
package/index.mjs
CHANGED
|
@@ -1,29 +1,33 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { selectTools } from "./server.mjs";
|
|
3
|
-
import { endpoints } from "./tools.mjs";
|
|
4
3
|
import { parseCLIOptions } from "./options.mjs";
|
|
5
4
|
import { launchStdioServer } from "./stdio.mjs";
|
|
6
5
|
import { launchStreamableHTTPServer } from "./http.mjs";
|
|
6
|
+
import { configureLogger, getLogger } from "./logger.mjs";
|
|
7
7
|
async function main() {
|
|
8
8
|
const options = parseOptionsOrError();
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
const selectedTools = await selectToolsOrError(
|
|
14
|
-
|
|
9
|
+
configureLogger({
|
|
10
|
+
level: options.debug ? 'debug' : 'info',
|
|
11
|
+
pretty: options.logFormat === 'pretty',
|
|
12
|
+
});
|
|
13
|
+
const selectedTools = await selectToolsOrError(options);
|
|
14
|
+
getLogger().info({ tools: selectedTools.map((e) => e.tool.name) }, `MCP Server starting with ${selectedTools.length} tools`);
|
|
15
15
|
switch (options.transport) {
|
|
16
16
|
case 'stdio':
|
|
17
17
|
await launchStdioServer(options);
|
|
18
18
|
break;
|
|
19
19
|
case 'http':
|
|
20
|
-
await launchStreamableHTTPServer(
|
|
20
|
+
await launchStreamableHTTPServer({
|
|
21
|
+
mcpOptions: options,
|
|
22
|
+
port: options.socket ?? options.port,
|
|
23
|
+
});
|
|
21
24
|
break;
|
|
22
25
|
}
|
|
23
26
|
}
|
|
24
27
|
if (require.main === module) {
|
|
25
28
|
main().catch((error) => {
|
|
26
|
-
|
|
29
|
+
// Logger might not be initialized yet
|
|
30
|
+
console.error('Fatal error in main()', error);
|
|
27
31
|
process.exit(1);
|
|
28
32
|
});
|
|
29
33
|
}
|
|
@@ -32,58 +36,23 @@ function parseOptionsOrError() {
|
|
|
32
36
|
return parseCLIOptions();
|
|
33
37
|
}
|
|
34
38
|
catch (error) {
|
|
35
|
-
|
|
39
|
+
// Logger is initialized after options, so use console.error here
|
|
40
|
+
console.error('Error parsing options', error);
|
|
36
41
|
process.exit(1);
|
|
37
42
|
}
|
|
38
43
|
}
|
|
39
|
-
async function selectToolsOrError(
|
|
44
|
+
async function selectToolsOrError(options) {
|
|
40
45
|
try {
|
|
41
|
-
const includedTools =
|
|
46
|
+
const includedTools = selectTools(options);
|
|
42
47
|
if (includedTools.length === 0) {
|
|
43
|
-
|
|
48
|
+
getLogger().error('No tools match the provided filters');
|
|
44
49
|
process.exit(1);
|
|
45
50
|
}
|
|
46
51
|
return includedTools;
|
|
47
52
|
}
|
|
48
53
|
catch (error) {
|
|
49
|
-
|
|
50
|
-
console.error('Error filtering tools:', error.message);
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
console.error('Error filtering tools:', error);
|
|
54
|
-
}
|
|
54
|
+
getLogger().error({ error }, 'Error filtering tools');
|
|
55
55
|
process.exit(1);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
function listAllTools() {
|
|
59
|
-
if (endpoints.length === 0) {
|
|
60
|
-
console.log('No tools available.');
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
console.log('Available tools:\n');
|
|
64
|
-
// Group endpoints by resource
|
|
65
|
-
const resourceGroups = new Map();
|
|
66
|
-
for (const endpoint of endpoints) {
|
|
67
|
-
const resource = endpoint.metadata.resource;
|
|
68
|
-
if (!resourceGroups.has(resource)) {
|
|
69
|
-
resourceGroups.set(resource, []);
|
|
70
|
-
}
|
|
71
|
-
resourceGroups.get(resource).push(endpoint);
|
|
72
|
-
}
|
|
73
|
-
// Sort resources alphabetically
|
|
74
|
-
const sortedResources = Array.from(resourceGroups.keys()).sort();
|
|
75
|
-
// Display hierarchically by resource
|
|
76
|
-
for (const resource of sortedResources) {
|
|
77
|
-
console.log(`Resource: ${resource}`);
|
|
78
|
-
const resourceEndpoints = resourceGroups.get(resource);
|
|
79
|
-
// Sort endpoints by tool name
|
|
80
|
-
resourceEndpoints.sort((a, b) => a.tool.name.localeCompare(b.tool.name));
|
|
81
|
-
for (const endpoint of resourceEndpoints) {
|
|
82
|
-
const { tool, metadata: { operation, tags }, } = endpoint;
|
|
83
|
-
console.log(` - ${tool.name} (${operation}) ${tags.length > 0 ? `tags: ${tags.join(', ')}` : ''}`);
|
|
84
|
-
console.log(` Description: ${tool.description}`);
|
|
85
|
-
}
|
|
86
|
-
console.log('');
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
58
|
//# sourceMappingURL=index.mjs.map
|
package/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":";OAEO,EAAE,WAAW,EAAE;OACf,
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":";OAEO,EAAE,WAAW,EAAE;OACf,EAAc,eAAe,EAAE;OAC/B,EAAE,iBAAiB,EAAE;OACrB,EAAE,0BAA0B,EAAE;OAE9B,EAAE,eAAe,EAAE,SAAS,EAAE;AAErC,KAAK,UAAU,IAAI;IACjB,MAAM,OAAO,GAAG,mBAAmB,EAAE,CAAC;IACtC,eAAe,CAAC;QACd,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM;QACvC,MAAM,EAAE,OAAO,CAAC,SAAS,KAAK,QAAQ;KACvC,CAAC,CAAC;IAEH,MAAM,aAAa,GAAG,MAAM,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAExD,SAAS,EAAE,CAAC,IAAI,CACd,EAAE,KAAK,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAChD,4BAA4B,aAAa,CAAC,MAAM,QAAQ,CACzD,CAAC;IAEF,QAAQ,OAAO,CAAC,SAAS,EAAE,CAAC;QAC1B,KAAK,OAAO;YACV,MAAM,iBAAiB,CAAC,OAAO,CAAC,CAAC;YACjC,MAAM;QACR,KAAK,MAAM;YACT,MAAM,0BAA0B,CAAC;gBAC/B,UAAU,EAAE,OAAO;gBACnB,IAAI,EAAE,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,IAAI;aACrC,CAAC,CAAC;YACH,MAAM;IACV,CAAC;AACH,CAAC;AAED,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;IAC5B,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QACrB,sCAAsC;QACtC,OAAO,CAAC,KAAK,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAAC;QAC9C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,mBAAmB;IAC1B,IAAI,CAAC;QACH,OAAO,eAAe,EAAE,CAAC;IAC3B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,iEAAiE;QACjE,OAAO,CAAC,KAAK,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAAC;QAC9C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,KAAK,UAAU,kBAAkB,CAAC,OAAmB;IACnD,IAAI,CAAC;QACH,MAAM,aAAa,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;QAC3C,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC/B,SAAS,EAAE,CAAC,KAAK,CAAC,qCAAqC,CAAC,CAAC;YACzD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QACD,OAAO,aAAa,CAAC;IACvB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,SAAS,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,EAAE,uBAAuB,CAAC,CAAC;QACtD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instructions.d.mts","sourceRoot":"","sources":["src/instructions.ts"],"names":[],"mappings":"AA2BA,wBAAsB,eAAe,CAAC,eAAe,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,CAW1F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instructions.d.ts","sourceRoot":"","sources":["src/instructions.ts"],"names":[],"mappings":"AA2BA,wBAAsB,eAAe,CAAC,eAAe,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,CAW1F"}
|
package/instructions.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.getInstructions = getInstructions;
|
|
5
|
+
const util_1 = require("./util.js");
|
|
6
|
+
const logger_1 = require("./logger.js");
|
|
7
|
+
const INSTRUCTIONS_CACHE_TTL_MS = 15 * 60 * 1000; // 15 minutes
|
|
8
|
+
const instructionsCache = new Map();
|
|
9
|
+
// Periodically evict stale entries so the cache doesn't grow unboundedly.
|
|
10
|
+
const _cacheCleanupInterval = setInterval(() => {
|
|
11
|
+
const now = Date.now();
|
|
12
|
+
for (const [key, entry] of instructionsCache) {
|
|
13
|
+
if (now - entry.fetchedAt > INSTRUCTIONS_CACHE_TTL_MS) {
|
|
14
|
+
instructionsCache.delete(key);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}, INSTRUCTIONS_CACHE_TTL_MS);
|
|
18
|
+
// Don't keep the process alive just for cleanup.
|
|
19
|
+
_cacheCleanupInterval.unref();
|
|
20
|
+
async function getInstructions(stainlessApiKey) {
|
|
21
|
+
const cacheKey = stainlessApiKey ?? '';
|
|
22
|
+
const cached = instructionsCache.get(cacheKey);
|
|
23
|
+
if (cached && Date.now() - cached.fetchedAt <= INSTRUCTIONS_CACHE_TTL_MS) {
|
|
24
|
+
return cached.fetchedInstructions;
|
|
25
|
+
}
|
|
26
|
+
const fetchedInstructions = await fetchLatestInstructions(stainlessApiKey);
|
|
27
|
+
instructionsCache.set(cacheKey, { fetchedInstructions, fetchedAt: Date.now() });
|
|
28
|
+
return fetchedInstructions;
|
|
29
|
+
}
|
|
30
|
+
async function fetchLatestInstructions(stainlessApiKey) {
|
|
31
|
+
// Setting the stainless API key is optional, but may be required
|
|
32
|
+
// to authenticate requests to the Stainless API.
|
|
33
|
+
const response = await fetch((0, util_1.readEnv)('CODE_MODE_INSTRUCTIONS_URL') ??
|
|
34
|
+
'https://api.stainless.com/api/ai/instructions/beeper-desktop-api', {
|
|
35
|
+
method: 'GET',
|
|
36
|
+
headers: { ...(stainlessApiKey && { Authorization: stainlessApiKey }) },
|
|
37
|
+
});
|
|
38
|
+
let instructions;
|
|
39
|
+
if (!response.ok) {
|
|
40
|
+
(0, logger_1.getLogger)().warn('Warning: failed to retrieve MCP server instructions. Proceeding with default instructions...');
|
|
41
|
+
instructions =
|
|
42
|
+
'\n This is the beeper-desktop-api MCP server.\n\n Available tools:\n - search_docs: Search SDK documentation to find the right methods and parameters.\n - execute: Run TypeScript code against a pre-authenticated SDK client. Define an async run(client) function.\n\n Workflow:\n - If unsure about the API, call search_docs first.\n - Write complete solutions in a single execute call when possible. For large datasets, use API filters to narrow results or paginate within a single execute block.\n - If execute returns an error, read the error and fix your code rather than retrying the same approach.\n - Variables do not persist between execute calls. Return or log all data you need.\n - Individual HTTP requests to the API have a 30-second timeout. If a request times out, try a smaller query or add filters.\n - Code execution has a total timeout of approximately 5 minutes. If your code times out, simplify it or break it into smaller steps.\n ';
|
|
43
|
+
}
|
|
44
|
+
instructions ??= (await response.json()).instructions;
|
|
45
|
+
instructions += `\nAccess to all chats and messages across networks using Beeper Desktop. Can be used to find, get, send, and manage messages and chats.`;
|
|
46
|
+
return instructions;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=instructions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instructions.js","sourceRoot":"","sources":["src/instructions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;AA2BtF,0CAWC;AApCD,oCAAiC;AACjC,wCAAqC;AAErC,MAAM,yBAAyB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,aAAa;AAO/D,MAAM,iBAAiB,GAAG,I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Aa,EAAE,eAAe,EAAE,CAAC,EAAE;KACxE,CACF,CAAC;IAEF,IAAI,YAAgC,CAAC;IACrC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,IAAA,kBAAS,GAAE,CAAC,IAAI,CACd,8FAA8F,CAC/F,CAAC;QAEF,YAAY;YACV,m8BAAm8B,CAAC;IACx8B,CAAC;IAED,YAAY,KAAM,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAA8B,CAAC,YAAY,CAAC;IAEpF,YAAY,IAAI,yIAAyI,CAAC;IAC1J,OAAO,YAAY,CAAC;AACtB,CAAC"}
|
package/instructions.mjs
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { readEnv } from "./util.mjs";
|
|
3
|
+
import { getLogger } from "./logger.mjs";
|
|
4
|
+
const INSTRUCTIONS_CACHE_TTL_MS = 15 * 60 * 1000; // 15 minutes
|
|
5
|
+
const instructionsCache = new Map();
|
|
6
|
+
// Periodically evict stale entries so the cache doesn't grow unboundedly.
|
|
7
|
+
const _cacheCleanupInterval = setInterval(() => {
|
|
8
|
+
const now = Date.now();
|
|
9
|
+
for (const [key, entry] of instructionsCache) {
|
|
10
|
+
if (now - entry.fetchedAt > INSTRUCTIONS_CACHE_TTL_MS) {
|
|
11
|
+
instructionsCache.delete(key);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}, INSTRUCTIONS_CACHE_TTL_MS);
|
|
15
|
+
// Don't keep the process alive just for cleanup.
|
|
16
|
+
_cacheCleanupInterval.unref();
|
|
17
|
+
export async function getInstructions(stainlessApiKey) {
|
|
18
|
+
const cacheKey = stainlessApiKey ?? '';
|
|
19
|
+
const cached = instructionsCache.get(cacheKey);
|
|
20
|
+
if (cached && Date.now() - cached.fetchedAt <= INSTRUCTIONS_CACHE_TTL_MS) {
|
|
21
|
+
return cached.fetchedInstructions;
|
|
22
|
+
}
|
|
23
|
+
const fetchedInstructions = await fetchLatestInstructions(stainlessApiKey);
|
|
24
|
+
instructionsCache.set(cacheKey, { fetchedInstructions, fetchedAt: Date.now() });
|
|
25
|
+
return fetchedInstructions;
|
|
26
|
+
}
|
|
27
|
+
async function fetchLatestInstructions(stainlessApiKey) {
|
|
28
|
+
// Setting the stainless API key is optional, but may be required
|
|
29
|
+
// to authenticate requests to the Stainless API.
|
|
30
|
+
const response = await fetch(readEnv('CODE_MODE_INSTRUCTIONS_URL') ??
|
|
31
|
+
'https://api.stainless.com/api/ai/instructions/beeper-desktop-api', {
|
|
32
|
+
method: 'GET',
|
|
33
|
+
headers: { ...(stainlessApiKey && { Authorization: stainlessApiKey }) },
|
|
34
|
+
});
|
|
35
|
+
let instructions;
|
|
36
|
+
if (!response.ok) {
|
|
37
|
+
getLogger().warn('Warning: failed to retrieve MCP server instructions. Proceeding with default instructions...');
|
|
38
|
+
instructions =
|
|
39
|
+
'\n This is the beeper-desktop-api MCP server.\n\n Available tools:\n - search_docs: Search SDK documentation to find the right methods and parameters.\n - execute: Run TypeScript code against a pre-authenticated SDK client. Define an async run(client) function.\n\n Workflow:\n - If unsure about the API, call search_docs first.\n - Write complete solutions in a single execute call when possible. For large datasets, use API filters to narrow results or paginate within a single execute block.\n - If execute returns an error, read the error and fix your code rather than retrying the same approach.\n - Variables do not persist between execute calls. Return or log all data you need.\n - Individual HTTP requests to the API have a 30-second timeout. If a request times out, try a smaller query or add filters.\n - Code execution has a total timeout of approximately 5 minutes. If your code times out, simplify it or break it into smaller steps.\n ';
|
|
40
|
+
}
|
|
41
|
+
instructions ??= (await response.json()).instructions;
|
|
42
|
+
instructions += `\nAccess to all chats and messages across networks using Beeper Desktop. Can be used to find, get, send, and manage messages and chats.`;
|
|
43
|
+
return instructions;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=instructions.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instructions.mjs","sourceRoot":"","s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mC;IACxE,iEAAiE;IACjE,iDAAiD;IACjD,MAAM,QAAQ,GAAG,MAAM,KAAK,CAC1B,OAAO,CAAC,4BAA4B,CAAC;QACnC,kEAAkE,EACpE;QACE,MAAM,EAAE,KAAK;QACb,OAAO,EAAE,EAAE,GAAG,CAAC,eAAe,IAAI,EAAE,aAAa,EAAE,eAAe,EAAE,CAAC,EAAE;KACxE,CACF,CAAC;IAEF,IAAI,YAAgC,CAAC;IACrC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,SAAS,EAAE,CAAC,IAAI,CACd,8FAA8F,CAC/F,CAAC;QAEF,YAAY;YACV,m8BAAm8B,CAAC;IACx8B,CAAC;IAED,YAAY,KAAM,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAA8B,CAAC,YAAY,CAAC;IAEpF,YAAY,IAAI,yIAAyI,CAAC;IAC1J,OAAO,YAAY,CAAC;AACtB,CAAC"}
|
package/logger.d.mts
ADDED
package/logger.d.mts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.mts","sourceRoot":"","sources":["src/logger.ts"],"names":[],"mappings":"OAEO,EAAQ,KAAK,KAAK,EAAE,KAAK,MAAM,EAAE,MAAM,MAAM;AAKpD,wBAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAarG;AAED,wBAAgB,SAAS,IAAI,MAAM,CAKlC"}
|
package/logger.d.ts
ADDED
package/logger.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["src/logger.ts"],"names":[],"mappings":"OAEO,EAAQ,KAAK,KAAK,EAAE,KAAK,MAAM,EAAE,MAAM,MAAM;AAKpD,wBAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAarG;AAED,wBAAgB,SAAS,IAAI,MAAM,CAKlC"}
|
package/logger.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.configureLogger = configureLogger;
|
|
8
|
+
exports.getLogger = getLogger;
|
|
9
|
+
const pino_1 = require("pino");
|
|
10
|
+
const pino_pretty_1 = __importDefault(require("pino-pretty"));
|
|
11
|
+
let _logger;
|
|
12
|
+
function configureLogger({ level, pretty: usePretty }) {
|
|
13
|
+
_logger = (0, pino_1.pino)({
|
|
14
|
+
level,
|
|
15
|
+
timestamp: pino_1.pino.stdTimeFunctions.isoTime,
|
|
16
|
+
formatters: {
|
|
17
|
+
level(label) {
|
|
18
|
+
return { level: label };
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
}, usePretty ? (0, pino_pretty_1.default)({ colorize: true, levelFirst: true, destination: 2 }) : process.stderr);
|
|
22
|
+
}
|
|
23
|
+
function getLogger() {
|
|
24
|
+
if (!_logger) {
|
|
25
|
+
throw new Error('Logger has not been configured. Call configureLogger() before using the logger.');
|
|
26
|
+
}
|
|
27
|
+
return _logger;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=logger.js.map
|
package/logger.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["src/logger.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;AAOtF,0CAaC;AAED,8BAKC;AAzBD,+BAAqD;AACrD,8DAAiC;AAEjC,IAAI,OAA2B,CAAC;AAEhC,SAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAqC;IAC7F,OAAO,GAAG,IAAA,WAAI,EACZ;QACE,KAAK;QACL,SAAS,EAAE,WAAI,CAAC,gBAAgB,CAAC,OAAO;QACxC,UAAU,EAAE;YACV,KAAK,CAAC,KAAK;gBACT,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;YAC1B,CAAC;SACF;KACF,EACD,SAAS,CAAC,CAAC,CAAC,IAAA,qBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAC1F,CAAC;AACJ,CAAC;AAED,SAAgB,SAAS;IACvB,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,iFAAiF,CAAC,CAAC;IACrG,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/logger.mjs
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { pino } from 'pino';
|
|
3
|
+
import pretty from 'pino-pretty';
|
|
4
|
+
let _logger;
|
|
5
|
+
export function configureLogger({ level, pretty: usePretty }) {
|
|
6
|
+
_logger = pino({
|
|
7
|
+
level,
|
|
8
|
+
timestamp: pino.stdTimeFunctions.isoTime,
|
|
9
|
+
formatters: {
|
|
10
|
+
level(label) {
|
|
11
|
+
return { level: label };
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
}, usePretty ? pretty({ colorize: true, levelFirst: true, destination: 2 }) : process.stderr);
|
|
15
|
+
}
|
|
16
|
+
export function getLogger() {
|
|
17
|
+
if (!_logger) {
|
|
18
|
+
throw new Error('Logger has not been configured. Call configureLogger() before using the logger.');
|
|
19
|
+
}
|
|
20
|
+
return _logger;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=logger.mjs.map
|
package/logger.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.mjs","sourceRoot":"","sources":["src/logger.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,IAAI,EAA2B,MAAM,MAAM;OAC7C,MAAM,MAAM,aAAa;AAEhC,IAAI,OAA2B,CAAC;AAEhC,MAAM,UAAU,eAAe,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAqC;IAC7F,OAAO,GAAG,IAAI,CACZ;QACE,KAAK;QACL,SAAS,EAAE,IAAI,CAAC,gBAAgB,CAAC,OAAO;QACxC,UAAU,EAAE;YACV,KAAK,CAAC,KAAK;gBACT,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;YAC1B,CAAC;SACF;KACF,EACD,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAC1F,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,SAAS;IACvB,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,iFAAiF,CAAC,CAAC;IACrG,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/methods.d.mts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { McpOptions } from "./options.mjs";
|
|
2
|
+
export type SdkMethod = {
|
|
3
|
+
clientCallName: string;
|
|
4
|
+
fullyQualifiedName: string;
|
|
5
|
+
httpMethod?: 'get' | 'post' | 'put' | 'patch' | 'delete' | 'query';
|
|
6
|
+
httpPath?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const sdkMethods: SdkMethod[];
|
|
9
|
+
export declare function blockedMethodsForCodeTool(options: McpOptions | undefined): SdkMethod[] | undefined;
|
|
10
|
+
//# sourceMappingURL=methods.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"methods.d.mts","sourceRoot":"","sources":["src/methods.ts"],"names":[],"mappings":"OAEO,EAAE,UAAU,EAAE;AAErB,MAAM,MAAM,SAAS,GAAG;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,UAAU,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACnE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,SAAS,EA2IjC,CAAC;AA+DF,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,UAAU,GAAG,SAAS,GAAG,SAAS,EAAE,GAAG,SAAS,CAUlG"}
|
package/methods.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { McpOptions } from "./options.js";
|
|
2
|
+
export type SdkMethod = {
|
|
3
|
+
clientCallName: string;
|
|
4
|
+
fullyQualifiedName: string;
|
|
5
|
+
httpMethod?: 'get' | 'post' | 'put' | 'patch' | 'delete' | 'query';
|
|
6
|
+
httpPath?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const sdkMethods: SdkMethod[];
|
|
9
|
+
export declare function blockedMethodsForCodeTool(options: McpOptions | undefined): SdkMethod[] | undefined;
|
|
10
|
+
//# sourceMappingURL=methods.d.ts.map
|
package/methods.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"methods.d.ts","sourceRoot":"","sources":["src/methods.ts"],"names":[],"mappings":"OAEO,EAAE,UAAU,EAAE;AAErB,MAAM,MAAM,SAAS,GAAG;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,UAAU,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACnE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,SAAS,EA2IjC,CAAC;AA+DF,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,UAAU,GAAG,SAAS,GAAG,SAAS,EAAE,GAAG,SAAS,CAUlG"}
|
package/methods.js
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.sdkMethods = void 0;
|
|
5
|
+
exports.blockedMethodsForCodeTool = blockedMethodsForCodeTool;
|
|
6
|
+
exports.sdkMethods = [
|
|
7
|
+
{
|
|
8
|
+
clientCallName: 'client.focus',
|
|
9
|
+
fullyQualifiedName: 'focus',
|
|
10
|
+
httpMethod: 'post',
|
|
11
|
+
httpPath: '/v1/focus',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
clientCallName: 'client.search',
|
|
15
|
+
fullyQualifiedName: 'search',
|
|
16
|
+
httpMethod: 'get',
|
|
17
|
+
httpPath: '/v1/search',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
clientCallName: 'client.accounts.list',
|
|
21
|
+
fullyQualifiedName: 'accounts.list',
|
|
22
|
+
httpMethod: 'get',
|
|
23
|
+
httpPath: '/v1/accounts',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
clientCallName: 'client.accounts.contacts.list',
|
|
27
|
+
fullyQualifiedName: 'accounts.contacts.list',
|
|
28
|
+
httpMethod: 'get',
|
|
29
|
+
httpPath: '/v1/accounts/{accountID}/contacts/list',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
clientCallName: 'client.accounts.contacts.search',
|
|
33
|
+
fullyQualifiedName: 'accounts.contacts.search',
|
|
34
|
+
httpMethod: 'get',
|
|
35
|
+
httpPath: '/v1/accounts/{accountID}/contacts',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
clientCallName: 'client.chats.create',
|
|
39
|
+
fullyQualifiedName: 'chats.create',
|
|
40
|
+
httpMethod: 'post',
|
|
41
|
+
httpPath: '/v1/chats',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
clientCallName: 'client.chats.retrieve',
|
|
45
|
+
fullyQualifiedName: 'chats.retrieve',
|
|
46
|
+
httpMethod: 'get',
|
|
47
|
+
httpPath: '/v1/chats/{chatID}',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
clientCallName: 'client.chats.list',
|
|
51
|
+
fullyQualifiedName: 'chats.list',
|
|
52
|
+
httpMethod: 'get',
|
|
53
|
+
httpPath: '/v1/chats',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
clientCallName: 'client.chats.archive',
|
|
57
|
+
fullyQualifiedName: 'chats.archive',
|
|
58
|
+
httpMethod: 'post',
|
|
59
|
+
httpPath: '/v1/chats/{chatID}/archive',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
clientCallName: 'client.chats.search',
|
|
63
|
+
fullyQualifiedName: 'chats.search',
|
|
64
|
+
httpMethod: 'get',
|
|
65
|
+
httpPath: '/v1/chats/search',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
clientCallName: 'client.chats.reminders.create',
|
|
69
|
+
fullyQualifiedName: 'chats.reminders.create',
|
|
70
|
+
httpMethod: 'post',
|
|
71
|
+
httpPath: '/v1/chats/{chatID}/reminders',
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
clientCallName: 'client.chats.reminders.delete',
|
|
75
|
+
fullyQualifiedName: 'chats.reminders.delete',
|
|
76
|
+
httpMethod: 'delete',
|
|
77
|
+
httpPath: '/v1/chats/{chatID}/reminders',
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
clientCallName: 'client.chats.messages.reactions.delete',
|
|
81
|
+
fullyQualifiedName: 'chats.messages.reactions.delete',
|
|
82
|
+
httpMethod: 'delete',
|
|
83
|
+
httpPath: '/v1/chats/{chatID}/messages/{messageID}/reactions',
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
clientCallName: 'client.chats.messages.reactions.add',
|
|
87
|
+
fullyQualifiedName: 'chats.messages.reactions.add',
|
|
88
|
+
httpMethod: 'post',
|
|
89
|
+
httpPath: '/v1/chats/{chatID}/messages/{messageID}/reactions',
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
clientCallName: 'client.messages.update',
|
|
93
|
+
fullyQualifiedName: 'messages.update',
|
|
94
|
+
httpMethod: 'put',
|
|
95
|
+
httpPath: '/v1/chats/{chatID}/messages/{messageID}',
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
clientCallName: 'client.messages.list',
|
|
99
|
+
fullyQualifiedName: 'messages.list',
|
|
100
|
+
httpMethod: 'get',
|
|
101
|
+
httpPath: '/v1/chats/{chatID}/messages',
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
clientCallName: 'client.messages.search',
|
|
105
|
+
fullyQualifiedName: 'messages.search',
|
|
106
|
+
httpMethod: 'get',
|
|
107
|
+
httpPath: '/v1/messages/search',
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
clientCallName: 'client.messages.send',
|
|
111
|
+
fullyQualifiedName: 'messages.send',
|
|
112
|
+
httpMethod: 'post',
|
|
113
|
+
httpPath: '/v1/chats/{chatID}/messages',
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
clientCallName: 'client.assets.download',
|
|
117
|
+
fullyQualifiedName: 'assets.download',
|
|
118
|
+
httpMethod: 'post',
|
|
119
|
+
httpPath: '/v1/assets/download',
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
clientCallName: 'client.assets.serve',
|
|
123
|
+
fullyQualifiedName: 'assets.serve',
|
|
124
|
+
httpMethod: 'get',
|
|
125
|
+
httpPath: '/v1/assets/serve',
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
clientCallName: 'client.assets.upload',
|
|
129
|
+
fullyQualifiedName: 'assets.upload',
|
|
130
|
+
httpMethod: 'post',
|
|
131
|
+
httpPath: '/v1/assets/upload',
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
clientCallName: 'client.assets.uploadBase64',
|
|
135
|
+
fullyQualifiedName: 'assets.uploadBase64',
|
|
136
|
+
httpMethod: 'post',
|
|
137
|
+
httpPath: '/v1/assets/upload/base64',
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
clientCallName: 'client.info.retrieve',
|
|
141
|
+
fullyQualifiedName: 'info.retrieve',
|
|
142
|
+
httpMethod: 'get',
|
|
143
|
+
httpPath: '/v1/info',
|
|
144
|
+
},
|
|
145
|
+
];
|
|
146
|
+
function allowedMethodsForCodeTool(options) {
|
|
147
|
+
if (!options) {
|
|
148
|
+
return undefined;
|
|
149
|
+
}
|
|
150
|
+
let allowedMethods;
|
|
151
|
+
if (options.codeAllowHttpGets || options.codeAllowedMethods) {
|
|
152
|
+
// Start with nothing allowed and then add into it from options
|
|
153
|
+
let allowedMethodsSet = new Set();
|
|
154
|
+
if (options.codeAllowHttpGets) {
|
|
155
|
+
// Add all methods that map to an HTTP GET
|
|
156
|
+
exports.sdkMethods
|
|
157
|
+
.filter((method) => method.httpMethod === 'get')
|
|
158
|
+
.forEach((method) => allowedMethodsSet.add(method));
|
|
159
|
+
}
|
|
160
|
+
if (options.codeAllowedMethods) {
|
|
161
|
+
// Add all methods that match any of the allowed regexps
|
|
162
|
+
const allowedRegexps = options.codeAllowedMethods.map((pattern) => {
|
|
163
|
+
try {
|
|
164
|
+
return new RegExp(pattern);
|
|
165
|
+
}
|
|
166
|
+
catch (e) {
|
|
167
|
+
throw new Error(`Invalid regex pattern for allowed method: "${pattern}": ${e instanceof Error ? e.message : e}`);
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
exports.sdkMethods
|
|
171
|
+
.filter((method) => allowedRegexps.some((regexp) => regexp.test(method.fullyQualifiedName)))
|
|
172
|
+
.forEach((method) => allowedMethodsSet.add(method));
|
|
173
|
+
}
|
|
174
|
+
allowedMethods = Array.from(allowedMethodsSet);
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
// Start with everything allowed
|
|
178
|
+
allowedMethods = [...exports.sdkMethods];
|
|
179
|
+
}
|
|
180
|
+
if (options.codeBlockedMethods) {
|
|
181
|
+
// Filter down based on blocked regexps
|
|
182
|
+
const blockedRegexps = options.codeBlockedMethods.map((pattern) => {
|
|
183
|
+
try {
|
|
184
|
+
return new RegExp(pattern);
|
|
185
|
+
}
|
|
186
|
+
catch (e) {
|
|
187
|
+
throw new Error(`Invalid regex pattern for blocked method: "${pattern}": ${e instanceof Error ? e.message : e}`);
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
allowedMethods = allowedMethods.filter((method) => !blockedRegexps.some((regexp) => regexp.test(method.fullyQualifiedName)));
|
|
191
|
+
}
|
|
192
|
+
return allowedMethods;
|
|
193
|
+
}
|
|
194
|
+
function blockedMethodsForCodeTool(options) {
|
|
195
|
+
const allowedMethods = allowedMethodsForCodeTool(options);
|
|
196
|
+
if (!allowedMethods) {
|
|
197
|
+
return undefined;
|
|
198
|
+
}
|
|
199
|
+
const allowedSet = new Set(allowedMethods.map((method) => method.fullyQualifiedName));
|
|
200
|
+
// Return any methods that are not explicitly allowed
|
|
201
|
+
return exports.sdkMethods.filter((method) => !allowedSet.has(method.fullyQualifiedName));
|
|
202
|
+
}
|
|
203
|
+
//# sourceMappingURL=methods.js.map
|
package/methods.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"methods.js","sourceRoot":"","sources":["src/methods.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAqNtF,8DAUC;AApNY,QAAA,UAAU,GAAgB;IACrC;QACE,cAAc,EAAE,cAAc;QAC9B,kBAA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