@beeper/desktop-mcp 0.1.2
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 +7 -0
- package/README.md +252 -0
- package/code-tool-paths.cjs +6 -0
- package/code-tool-paths.cjs.map +1 -0
- package/code-tool-paths.d.cts +2 -0
- package/code-tool-paths.d.cts.map +1 -0
- package/code-tool-types.d.mts +14 -0
- package/code-tool-types.d.mts.map +1 -0
- package/code-tool-types.d.ts +14 -0
- package/code-tool-types.d.ts.map +1 -0
- package/code-tool-types.js +4 -0
- package/code-tool-types.js.map +1 -0
- package/code-tool-types.mjs +3 -0
- package/code-tool-types.mjs.map +1 -0
- package/code-tool-worker.d.mts +5 -0
- package/code-tool-worker.d.mts.map +1 -0
- package/code-tool-worker.d.ts +5 -0
- package/code-tool-worker.d.ts.map +1 -0
- package/code-tool-worker.js +45 -0
- package/code-tool-worker.js.map +1 -0
- package/code-tool-worker.mjs +40 -0
- package/code-tool-worker.mjs.map +1 -0
- package/code-tool.d.mts +12 -0
- package/code-tool.d.mts.map +1 -0
- package/code-tool.d.ts +12 -0
- package/code-tool.d.ts.map +1 -0
- package/code-tool.js +123 -0
- package/code-tool.js.map +1 -0
- package/code-tool.mjs +120 -0
- package/code-tool.mjs.map +1 -0
- package/compat.d.mts +58 -0
- package/compat.d.mts.map +1 -0
- package/compat.d.ts +58 -0
- package/compat.d.ts.map +1 -0
- package/compat.js +387 -0
- package/compat.js.map +1 -0
- package/compat.mjs +378 -0
- package/compat.mjs.map +1 -0
- package/dynamic-tools.d.mts +12 -0
- package/dynamic-tools.d.mts.map +1 -0
- package/dynamic-tools.d.ts +12 -0
- package/dynamic-tools.d.ts.map +1 -0
- package/dynamic-tools.js +135 -0
- package/dynamic-tools.js.map +1 -0
- package/dynamic-tools.mjs +132 -0
- package/dynamic-tools.mjs.map +1 -0
- package/filtering.d.mts +2 -0
- package/filtering.d.mts.map +1 -0
- package/filtering.d.ts +2 -0
- package/filtering.d.ts.map +1 -0
- package/filtering.js +20 -0
- package/filtering.js.map +1 -0
- package/filtering.mjs +13 -0
- package/filtering.mjs.map +1 -0
- package/headers.d.mts +4 -0
- package/headers.d.mts.map +1 -0
- package/headers.d.ts +4 -0
- package/headers.d.ts.map +1 -0
- package/headers.js +22 -0
- package/headers.js.map +1 -0
- package/headers.mjs +18 -0
- package/headers.mjs.map +1 -0
- package/http.d.mts +5 -0
- package/http.d.mts.map +1 -0
- package/http.d.ts +5 -0
- package/http.d.ts.map +1 -0
- package/http.js +127 -0
- package/http.js.map +1 -0
- package/http.mjs +119 -0
- package/http.mjs.map +1 -0
- package/index.d.mts +3 -0
- package/index.d.mts.map +1 -0
- package/index.d.ts +3 -0
- package/index.d.ts.map +1 -0
- package/index.js +91 -0
- package/index.js.map +1 -0
- package/index.mjs +89 -0
- package/index.mjs.map +1 -0
- package/options.d.mts +19 -0
- package/options.d.mts.map +1 -0
- package/options.d.ts +19 -0
- package/options.d.ts.map +1 -0
- package/options.js +417 -0
- package/options.js.map +1 -0
- package/options.mjs +410 -0
- package/options.mjs.map +1 -0
- package/package.json +206 -0
- package/server.d.mts +35 -0
- package/server.d.mts.map +1 -0
- package/server.d.ts +35 -0
- package/server.d.ts.map +1 -0
- package/server.js +151 -0
- package/server.js.map +1 -0
- package/server.mjs +137 -0
- package/server.mjs.map +1 -0
- package/src/code-tool-paths.cts +3 -0
- package/src/code-tool-types.ts +14 -0
- package/src/code-tool-worker.ts +46 -0
- package/src/code-tool.ts +144 -0
- package/src/compat.ts +483 -0
- package/src/dynamic-tools.ts +159 -0
- package/src/filtering.ts +14 -0
- package/src/headers.ts +23 -0
- package/src/http.ts +137 -0
- package/src/index.ts +108 -0
- package/src/options.ts +456 -0
- package/src/server.ts +184 -0
- package/src/stdio.ts +13 -0
- package/src/tools/accounts/get-accounts.ts +34 -0
- package/src/tools/app/open-app.ts +47 -0
- package/src/tools/chats/archive-chat.ts +42 -0
- package/src/tools/chats/get-chat.ts +46 -0
- package/src/tools/chats/search-chats.ts +101 -0
- package/src/tools/index.ts +89 -0
- package/src/tools/messages/get-attachment.ts +42 -0
- package/src/tools/messages/search-messages.ts +133 -0
- package/src/tools/messages/send-message.ts +46 -0
- package/src/tools/reminders/clear-chat-reminder.ts +38 -0
- package/src/tools/reminders/set-chat-reminder.ts +53 -0
- package/src/tools/types.ts +103 -0
- package/src/tools.ts +1 -0
- package/src/tsconfig.json +11 -0
- package/stdio.d.mts +3 -0
- package/stdio.d.mts.map +1 -0
- package/stdio.d.ts +3 -0
- package/stdio.d.ts.map +1 -0
- package/stdio.js +14 -0
- package/stdio.js.map +1 -0
- package/stdio.mjs +10 -0
- package/stdio.mjs.map +1 -0
- package/tools/accounts/get-accounts.d.mts +45 -0
- package/tools/accounts/get-accounts.d.mts.map +1 -0
- package/tools/accounts/get-accounts.d.ts +45 -0
- package/tools/accounts/get-accounts.d.ts.map +1 -0
- package/tools/accounts/get-accounts.js +31 -0
- package/tools/accounts/get-accounts.js.map +1 -0
- package/tools/accounts/get-accounts.mjs +27 -0
- package/tools/accounts/get-accounts.mjs.map +1 -0
- package/tools/app/open-app.d.mts +45 -0
- package/tools/app/open-app.d.mts.map +1 -0
- package/tools/app/open-app.d.ts +45 -0
- package/tools/app/open-app.d.ts.map +1 -0
- package/tools/app/open-app.js +43 -0
- package/tools/app/open-app.js.map +1 -0
- package/tools/app/open-app.mjs +39 -0
- package/tools/app/open-app.mjs.map +1 -0
- package/tools/chats/archive-chat.d.mts +45 -0
- package/tools/chats/archive-chat.d.mts.map +1 -0
- package/tools/chats/archive-chat.d.ts +45 -0
- package/tools/chats/archive-chat.d.ts.map +1 -0
- package/tools/chats/archive-chat.js +39 -0
- package/tools/chats/archive-chat.js.map +1 -0
- package/tools/chats/archive-chat.mjs +35 -0
- package/tools/chats/archive-chat.mjs.map +1 -0
- package/tools/chats/get-chat.d.mts +45 -0
- package/tools/chats/get-chat.d.mts.map +1 -0
- package/tools/chats/get-chat.d.ts +45 -0
- package/tools/chats/get-chat.d.ts.map +1 -0
- package/tools/chats/get-chat.js +41 -0
- package/tools/chats/get-chat.js.map +1 -0
- package/tools/chats/get-chat.mjs +37 -0
- package/tools/chats/get-chat.mjs.map +1 -0
- package/tools/chats/search-chats.d.mts +45 -0
- package/tools/chats/search-chats.d.mts.map +1 -0
- package/tools/chats/search-chats.d.ts +45 -0
- package/tools/chats/search-chats.d.ts.map +1 -0
- package/tools/chats/search-chats.js +90 -0
- package/tools/chats/search-chats.js.map +1 -0
- package/tools/chats/search-chats.mjs +86 -0
- package/tools/chats/search-chats.mjs.map +1 -0
- package/tools/index.d.mts +10 -0
- package/tools/index.d.mts.map +1 -0
- package/tools/index.d.ts +10 -0
- package/tools/index.d.ts.map +1 -0
- package/tools/index.js +73 -0
- package/tools/index.js.map +1 -0
- package/tools/index.mjs +66 -0
- package/tools/index.mjs.map +1 -0
- package/tools/messages/get-attachment.d.mts +45 -0
- package/tools/messages/get-attachment.d.mts.map +1 -0
- package/tools/messages/get-attachment.d.ts +45 -0
- package/tools/messages/get-attachment.d.ts.map +1 -0
- package/tools/messages/get-attachment.js +39 -0
- package/tools/messages/get-attachment.js.map +1 -0
- package/tools/messages/get-attachment.mjs +35 -0
- package/tools/messages/get-attachment.mjs.map +1 -0
- package/tools/messages/search-messages.d.mts +45 -0
- package/tools/messages/search-messages.d.mts.map +1 -0
- package/tools/messages/search-messages.d.ts +45 -0
- package/tools/messages/search-messages.d.ts.map +1 -0
- package/tools/messages/search-messages.js +121 -0
- package/tools/messages/search-messages.js.map +1 -0
- package/tools/messages/search-messages.mjs +117 -0
- package/tools/messages/search-messages.mjs.map +1 -0
- package/tools/messages/send-message.d.mts +45 -0
- package/tools/messages/send-message.d.mts.map +1 -0
- package/tools/messages/send-message.d.ts +45 -0
- package/tools/messages/send-message.d.ts.map +1 -0
- package/tools/messages/send-message.js +43 -0
- package/tools/messages/send-message.js.map +1 -0
- package/tools/messages/send-message.mjs +39 -0
- package/tools/messages/send-message.mjs.map +1 -0
- package/tools/reminders/clear-chat-reminder.d.mts +45 -0
- package/tools/reminders/clear-chat-reminder.d.mts.map +1 -0
- package/tools/reminders/clear-chat-reminder.d.ts +45 -0
- package/tools/reminders/clear-chat-reminder.d.ts.map +1 -0
- package/tools/reminders/clear-chat-reminder.js +35 -0
- package/tools/reminders/clear-chat-reminder.js.map +1 -0
- package/tools/reminders/clear-chat-reminder.mjs +31 -0
- package/tools/reminders/clear-chat-reminder.mjs.map +1 -0
- package/tools/reminders/set-chat-reminder.d.mts +45 -0
- package/tools/reminders/set-chat-reminder.d.mts.map +1 -0
- package/tools/reminders/set-chat-reminder.d.ts +45 -0
- package/tools/reminders/set-chat-reminder.d.ts.map +1 -0
- package/tools/reminders/set-chat-reminder.js +50 -0
- package/tools/reminders/set-chat-reminder.js.map +1 -0
- package/tools/reminders/set-chat-reminder.mjs +46 -0
- package/tools/reminders/set-chat-reminder.mjs.map +1 -0
- package/tools/types.d.mts +51 -0
- package/tools/types.d.mts.map +1 -0
- package/tools/types.d.ts +51 -0
- package/tools/types.d.ts.map +1 -0
- package/tools/types.js +46 -0
- package/tools/types.js.map +1 -0
- package/tools/types.mjs +42 -0
- package/tools/types.mjs.map +1 -0
- package/tools.d.mts +2 -0
- package/tools.d.mts.map +1 -0
- package/tools.d.ts +2 -0
- package/tools.d.ts.map +1 -0
- package/tools.js +18 -0
- package/tools.js.map +1 -0
- package/tools.mjs +2 -0
- package/tools.mjs.map +1 -0
|
@@ -0,0 +1,90 @@
|
|
|
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.handler = exports.tool = exports.metadata = void 0;
|
|
5
|
+
const types_1 = require("@beeper/desktop-mcp/tools/types");
|
|
6
|
+
exports.metadata = {
|
|
7
|
+
resource: 'chats',
|
|
8
|
+
operation: 'read',
|
|
9
|
+
tags: ['chats'],
|
|
10
|
+
httpMethod: 'get',
|
|
11
|
+
httpPath: '/v0/search-chats',
|
|
12
|
+
operationId: 'search_chats',
|
|
13
|
+
};
|
|
14
|
+
exports.tool = {
|
|
15
|
+
name: 'search_chats',
|
|
16
|
+
description: 'Search chats by inbox, type, unread status, or text. Paginates.',
|
|
17
|
+
inputSchema: {
|
|
18
|
+
type: 'object',
|
|
19
|
+
properties: {
|
|
20
|
+
accountIDs: {
|
|
21
|
+
type: 'array',
|
|
22
|
+
description: 'Provide an array of account IDs to filter chats from specific messaging accounts only',
|
|
23
|
+
items: {
|
|
24
|
+
type: 'string',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
cursor: {
|
|
28
|
+
type: 'string',
|
|
29
|
+
description: 'Pagination cursor from previous response. Use with direction to navigate results',
|
|
30
|
+
},
|
|
31
|
+
direction: {
|
|
32
|
+
type: 'string',
|
|
33
|
+
description: 'Pagination direction: "after" for newer page, "before" for older page. Defaults to "before" when only cursor is provided.',
|
|
34
|
+
enum: ['after', 'before'],
|
|
35
|
+
},
|
|
36
|
+
inbox: {
|
|
37
|
+
type: 'string',
|
|
38
|
+
description: 'Filter by inbox type: "primary" (non-archived, non-low-priority), "low-priority", or "archive". If not specified, shows all chats.',
|
|
39
|
+
enum: ['primary', 'low-priority', 'archive'],
|
|
40
|
+
},
|
|
41
|
+
includeMuted: {
|
|
42
|
+
type: 'boolean',
|
|
43
|
+
description: 'Include chats marked as Muted by the user, which are usually less important. Default: true. Set to false if the user wants a more refined search.',
|
|
44
|
+
},
|
|
45
|
+
lastActivityAfter: {
|
|
46
|
+
type: 'string',
|
|
47
|
+
description: 'Provide an ISO datetime string to only retrieve chats with last activity after this time',
|
|
48
|
+
format: 'date-time',
|
|
49
|
+
},
|
|
50
|
+
lastActivityBefore: {
|
|
51
|
+
type: 'string',
|
|
52
|
+
description: 'Provide an ISO datetime string to only retrieve chats with last activity before this time',
|
|
53
|
+
format: 'date-time',
|
|
54
|
+
},
|
|
55
|
+
limit: {
|
|
56
|
+
type: 'integer',
|
|
57
|
+
description: 'Set the maximum number of chats to retrieve. Valid range: 1-200, default is 50',
|
|
58
|
+
},
|
|
59
|
+
participantQuery: {
|
|
60
|
+
type: 'string',
|
|
61
|
+
description: 'Search string to filter chats by participant names. When multiple words provided, ALL words must match. Searches in username, displayName, and fullName fields.',
|
|
62
|
+
},
|
|
63
|
+
query: {
|
|
64
|
+
type: 'string',
|
|
65
|
+
description: 'Search string to filter chats by title. When multiple words provided, ALL words must match. Matches are case-insensitive substrings.',
|
|
66
|
+
},
|
|
67
|
+
type: {
|
|
68
|
+
type: 'string',
|
|
69
|
+
description: 'Specify the type of chats to retrieve: use "single" for direct messages, "group" for group chats, "channel" for channels, or "any" to get all types',
|
|
70
|
+
enum: ['single', 'group', 'channel', 'any'],
|
|
71
|
+
},
|
|
72
|
+
unreadOnly: {
|
|
73
|
+
type: 'boolean',
|
|
74
|
+
description: 'Set to true to only retrieve chats that have unread messages',
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
required: [],
|
|
78
|
+
},
|
|
79
|
+
annotations: {
|
|
80
|
+
readOnlyHint: true,
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
const handler = async (client, args) => {
|
|
84
|
+
const body = args;
|
|
85
|
+
const response = await client.chats.search(body).asResponse();
|
|
86
|
+
return (0, types_1.asTextContentResult)(await response.json());
|
|
87
|
+
};
|
|
88
|
+
exports.handler = handler;
|
|
89
|
+
exports.default = { metadata: exports.metadata, tool: exports.tool, handler: exports.handler };
|
|
90
|
+
//# sourceMappingURL=search-chats.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-chats.js","sourceRoot":"","sources":["../../src/tools/chats/search-chats.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,2DAAgF;AAKnE,QAAA,QAAQ,GAAa;IAChC,QAAQ,EAAE,OAAO;IACjB,SAAS,EAAE,MAAM;IACjB,IAAI,EAAE,CAAC,OAAO,CAAC;IACf,UAAU,EA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,EACT,qJAAqJ;gBACvJ,IAAI,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,CAAC;aAC5C;YACD,UAAU,EAAE;gBACV,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,8DAA8D;aAC5E;SACF;QACD,QAAQ,EAAE,EAAE;KACb;IACD,WAAW,EAAE;QACX,YAAY,EAAE,IAAI;KACnB;CACF,CAAC;AAEK,MAAM,OAAO,GAAG,KAAK,EAAE,MAAqB,EAAE,IAAyC,EAAE,EAAE;IAChG,MAAM,IAAI,GAAG,IAAW,CAAC;IACzB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;IAC9D,OAAO,IAAA,2BAAmB,EAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;AACpD,CAAC,CAAC;AAJW,QAAA,OAAO,WAIlB;AAEF,kBAAe,EAAE,QAAQ,EAAR,gBAAQ,EAAE,IAAI,EAAJ,YAAI,EAAE,OAAO,EAAP,eAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { asTextContentResult } from '@beeper/desktop-mcp/tools/types';
|
|
3
|
+
export const metadata = {
|
|
4
|
+
resource: 'chats',
|
|
5
|
+
operation: 'read',
|
|
6
|
+
tags: ['chats'],
|
|
7
|
+
httpMethod: 'get',
|
|
8
|
+
httpPath: '/v0/search-chats',
|
|
9
|
+
operationId: 'search_chats',
|
|
10
|
+
};
|
|
11
|
+
export const tool = {
|
|
12
|
+
name: 'search_chats',
|
|
13
|
+
description: 'Search chats by inbox, type, unread status, or text. Paginates.',
|
|
14
|
+
inputSchema: {
|
|
15
|
+
type: 'object',
|
|
16
|
+
properties: {
|
|
17
|
+
accountIDs: {
|
|
18
|
+
type: 'array',
|
|
19
|
+
description: 'Provide an array of account IDs to filter chats from specific messaging accounts only',
|
|
20
|
+
items: {
|
|
21
|
+
type: 'string',
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
cursor: {
|
|
25
|
+
type: 'string',
|
|
26
|
+
description: 'Pagination cursor from previous response. Use with direction to navigate results',
|
|
27
|
+
},
|
|
28
|
+
direction: {
|
|
29
|
+
type: 'string',
|
|
30
|
+
description: 'Pagination direction: "after" for newer page, "before" for older page. Defaults to "before" when only cursor is provided.',
|
|
31
|
+
enum: ['after', 'before'],
|
|
32
|
+
},
|
|
33
|
+
inbox: {
|
|
34
|
+
type: 'string',
|
|
35
|
+
description: 'Filter by inbox type: "primary" (non-archived, non-low-priority), "low-priority", or "archive". If not specified, shows all chats.',
|
|
36
|
+
enum: ['primary', 'low-priority', 'archive'],
|
|
37
|
+
},
|
|
38
|
+
includeMuted: {
|
|
39
|
+
type: 'boolean',
|
|
40
|
+
description: 'Include chats marked as Muted by the user, which are usually less important. Default: true. Set to false if the user wants a more refined search.',
|
|
41
|
+
},
|
|
42
|
+
lastActivityAfter: {
|
|
43
|
+
type: 'string',
|
|
44
|
+
description: 'Provide an ISO datetime string to only retrieve chats with last activity after this time',
|
|
45
|
+
format: 'date-time',
|
|
46
|
+
},
|
|
47
|
+
lastActivityBefore: {
|
|
48
|
+
type: 'string',
|
|
49
|
+
description: 'Provide an ISO datetime string to only retrieve chats with last activity before this time',
|
|
50
|
+
format: 'date-time',
|
|
51
|
+
},
|
|
52
|
+
limit: {
|
|
53
|
+
type: 'integer',
|
|
54
|
+
description: 'Set the maximum number of chats to retrieve. Valid range: 1-200, default is 50',
|
|
55
|
+
},
|
|
56
|
+
participantQuery: {
|
|
57
|
+
type: 'string',
|
|
58
|
+
description: 'Search string to filter chats by participant names. When multiple words provided, ALL words must match. Searches in username, displayName, and fullName fields.',
|
|
59
|
+
},
|
|
60
|
+
query: {
|
|
61
|
+
type: 'string',
|
|
62
|
+
description: 'Search string to filter chats by title. When multiple words provided, ALL words must match. Matches are case-insensitive substrings.',
|
|
63
|
+
},
|
|
64
|
+
type: {
|
|
65
|
+
type: 'string',
|
|
66
|
+
description: 'Specify the type of chats to retrieve: use "single" for direct messages, "group" for group chats, "channel" for channels, or "any" to get all types',
|
|
67
|
+
enum: ['single', 'group', 'channel', 'any'],
|
|
68
|
+
},
|
|
69
|
+
unreadOnly: {
|
|
70
|
+
type: 'boolean',
|
|
71
|
+
description: 'Set to true to only retrieve chats that have unread messages',
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
required: [],
|
|
75
|
+
},
|
|
76
|
+
annotations: {
|
|
77
|
+
readOnlyHint: true,
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
export const handler = async (client, args) => {
|
|
81
|
+
const body = args;
|
|
82
|
+
const response = await client.chats.search(body).asResponse();
|
|
83
|
+
return asTextContentResult(await response.json());
|
|
84
|
+
};
|
|
85
|
+
export default { metadata, tool, handler };
|
|
86
|
+
//# sourceMappingURL=search-chats.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-chats.mjs","sourceRoot":"","sources":["../../src/tools/chats/search-chats.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAY,mBAAmB,EAAE,MAAM,iCAAiC;AAK/E,MAAM,CAAC,MAAM,QAAQ,GAAa;IAChC,QAAQ,EAAE,OAAO;IACjB,SAAS,EAAE,MAAM;IACjB,IAAI,EAAE,CAAC,OAAO,CAAC;IACf,UAAU,EAAE,KAAK;IACjB,QAAQ,EAAE,kBAAkB;IAC5B,WAAW,EAAE,cAAc;CAC5B,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAAS;IACxB,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,iEAAiE;IAC9E,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,UAAU,EAAE;gBACV,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,uFAAuF;gBACpG,KAAK,EAAE;oBACL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AK,EAAE,MAAqB,EAAE,IAAyC,EAAE,EAAE;IAChG,MAAM,IAAI,GAAG,IAAW,CAAC;IACzB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;IAC9D,OAAO,mBAAmB,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;AACpD,CAAC,CAAC;AAEF,eAAe,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Metadata, Endpoint, HandlerFunction } from "./types.mjs";
|
|
2
|
+
export { Metadata, Endpoint, HandlerFunction };
|
|
3
|
+
export declare const endpoints: Endpoint[];
|
|
4
|
+
export type Filter = {
|
|
5
|
+
type: 'resource' | 'operation' | 'tag' | 'tool';
|
|
6
|
+
op: 'include' | 'exclude';
|
|
7
|
+
value: string;
|
|
8
|
+
};
|
|
9
|
+
export declare function query(filters: Filter[], endpoints: Endpoint[]): Endpoint[];
|
|
10
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/tools/index.ts"],"names":[],"mappings":"OAEO,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE;AAE9C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC;AAa/C,eAAO,MAAM,SAAS,EAAE,QAAQ,EAAO,CAAC;AAiBxC,MAAM,MAAM,MAAM,GAAG;IACnB,IAAI,EAAE,UAAU,GAAG,WAAW,GAAG,KAAK,GAAG,MAAM,CAAC;IAChD,EAAE,EAAE,SAAS,GAAG,SAAS,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,QAAQ,EAAE,CA4B1E"}
|
package/tools/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Metadata, Endpoint, HandlerFunction } from "./types.js";
|
|
2
|
+
export { Metadata, Endpoint, HandlerFunction };
|
|
3
|
+
export declare const endpoints: Endpoint[];
|
|
4
|
+
export type Filter = {
|
|
5
|
+
type: 'resource' | 'operation' | 'tag' | 'tool';
|
|
6
|
+
op: 'include' | 'exclude';
|
|
7
|
+
value: string;
|
|
8
|
+
};
|
|
9
|
+
export declare function query(filters: Filter[], endpoints: Endpoint[]): Endpoint[];
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/tools/index.ts"],"names":[],"mappings":"OAEO,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE;AAE9C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC;AAa/C,eAAO,MAAM,SAAS,EAAE,QAAQ,EAAO,CAAC;AAiBxC,MAAM,MAAM,MAAM,GAAG;IACnB,IAAI,EAAE,UAAU,GAAG,WAAW,GAAG,KAAK,GAAG,MAAM,CAAC;IAChD,EAAE,EAAE,SAAS,GAAG,SAAS,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,QAAQ,EAAE,CA4B1E"}
|
package/tools/index.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
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.endpoints = void 0;
|
|
8
|
+
exports.query = query;
|
|
9
|
+
const get_accounts_1 = __importDefault(require("./accounts/get-accounts.js"));
|
|
10
|
+
const open_app_1 = __importDefault(require("./app/open-app.js"));
|
|
11
|
+
const archive_chat_1 = __importDefault(require("./chats/archive-chat.js"));
|
|
12
|
+
const get_chat_1 = __importDefault(require("./chats/get-chat.js"));
|
|
13
|
+
const search_chats_1 = __importDefault(require("./chats/search-chats.js"));
|
|
14
|
+
const get_attachment_1 = __importDefault(require("./messages/get-attachment.js"));
|
|
15
|
+
const search_messages_1 = __importDefault(require("./messages/search-messages.js"));
|
|
16
|
+
const send_message_1 = __importDefault(require("./messages/send-message.js"));
|
|
17
|
+
const clear_chat_reminder_1 = __importDefault(require("./reminders/clear-chat-reminder.js"));
|
|
18
|
+
const set_chat_reminder_1 = __importDefault(require("./reminders/set-chat-reminder.js"));
|
|
19
|
+
exports.endpoints = [];
|
|
20
|
+
function addEndpoint(endpoint) {
|
|
21
|
+
exports.endpoints.push(endpoint);
|
|
22
|
+
}
|
|
23
|
+
addEndpoint(get_accounts_1.default);
|
|
24
|
+
addEndpoint(open_app_1.default);
|
|
25
|
+
addEndpoint(archive_chat_1.default);
|
|
26
|
+
addEndpoint(get_chat_1.default);
|
|
27
|
+
addEndpoint(search_chats_1.default);
|
|
28
|
+
addEndpoint(get_attachment_1.default);
|
|
29
|
+
addEndpoint(search_messages_1.default);
|
|
30
|
+
addEndpoint(send_message_1.default);
|
|
31
|
+
addEndpoint(clear_chat_reminder_1.default);
|
|
32
|
+
addEndpoint(set_chat_reminder_1.default);
|
|
33
|
+
function query(filters, endpoints) {
|
|
34
|
+
const allExcludes = filters.length > 0 && filters.every((filter) => filter.op === 'exclude');
|
|
35
|
+
const unmatchedFilters = new Set(filters);
|
|
36
|
+
const filtered = endpoints.filter((endpoint) => {
|
|
37
|
+
let included = false || allExcludes;
|
|
38
|
+
for (const filter of filters) {
|
|
39
|
+
if (match(filter, endpoint)) {
|
|
40
|
+
unmatchedFilters.delete(filter);
|
|
41
|
+
included = filter.op === 'include';
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return included;
|
|
45
|
+
});
|
|
46
|
+
// Check if any filters didn't match
|
|
47
|
+
const unmatched = Array.from(unmatchedFilters).filter((f) => f.type === 'tool' || f.type === 'resource');
|
|
48
|
+
if (unmatched.length > 0) {
|
|
49
|
+
throw new Error(`The following filters did not match any endpoints: ${unmatched
|
|
50
|
+
.map((f) => `${f.type}=${f.value}`)
|
|
51
|
+
.join(', ')}`);
|
|
52
|
+
}
|
|
53
|
+
return filtered;
|
|
54
|
+
}
|
|
55
|
+
function match({ type, value }, endpoint) {
|
|
56
|
+
switch (type) {
|
|
57
|
+
case 'resource': {
|
|
58
|
+
const regexStr = '^' + normalizeResource(value).replace(/\*/g, '.*') + '$';
|
|
59
|
+
const regex = new RegExp(regexStr);
|
|
60
|
+
return regex.test(normalizeResource(endpoint.metadata.resource));
|
|
61
|
+
}
|
|
62
|
+
case 'operation':
|
|
63
|
+
return endpoint.metadata.operation === value;
|
|
64
|
+
case 'tag':
|
|
65
|
+
return endpoint.metadata.tags.includes(value);
|
|
66
|
+
case 'tool':
|
|
67
|
+
return endpoint.tool.name === value;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function normalizeResource(resource) {
|
|
71
|
+
return resource.toLowerCase().replace(/[^a-z.*\-_]*/g, '');
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/tools/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;AAwCtF,sBA4BC;AA9DD,8EAAmD;AACnD,iEAAsC;AACtC,2EAAgD;AAChD,mEAAwC;AACxC,2EAAgD;AAChD,kFAAuD;AACvD,oFAAyD;AACzD,8EAAmD;AACnD,6FAAkE;AAClE,yFAA8D;AAEjD,QAAA,SAAS,GAAe,EAAE,CA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OAAO,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;AAC7D,CAAC"}
|
package/tools/index.mjs
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import get_accounts from "./accounts/get-accounts.mjs";
|
|
3
|
+
import open_app from "./app/open-app.mjs";
|
|
4
|
+
import archive_chat from "./chats/archive-chat.mjs";
|
|
5
|
+
import get_chat from "./chats/get-chat.mjs";
|
|
6
|
+
import search_chats from "./chats/search-chats.mjs";
|
|
7
|
+
import get_attachment from "./messages/get-attachment.mjs";
|
|
8
|
+
import search_messages from "./messages/search-messages.mjs";
|
|
9
|
+
import send_message from "./messages/send-message.mjs";
|
|
10
|
+
import clear_chat_reminder from "./reminders/clear-chat-reminder.mjs";
|
|
11
|
+
import set_chat_reminder from "./reminders/set-chat-reminder.mjs";
|
|
12
|
+
export const endpoints = [];
|
|
13
|
+
function addEndpoint(endpoint) {
|
|
14
|
+
endpoints.push(endpoint);
|
|
15
|
+
}
|
|
16
|
+
addEndpoint(get_accounts);
|
|
17
|
+
addEndpoint(open_app);
|
|
18
|
+
addEndpoint(archive_chat);
|
|
19
|
+
addEndpoint(get_chat);
|
|
20
|
+
addEndpoint(search_chats);
|
|
21
|
+
addEndpoint(get_attachment);
|
|
22
|
+
addEndpoint(search_messages);
|
|
23
|
+
addEndpoint(send_message);
|
|
24
|
+
addEndpoint(clear_chat_reminder);
|
|
25
|
+
addEndpoint(set_chat_reminder);
|
|
26
|
+
export function query(filters, endpoints) {
|
|
27
|
+
const allExcludes = filters.length > 0 && filters.every((filter) => filter.op === 'exclude');
|
|
28
|
+
const unmatchedFilters = new Set(filters);
|
|
29
|
+
const filtered = endpoints.filter((endpoint) => {
|
|
30
|
+
let included = false || allExcludes;
|
|
31
|
+
for (const filter of filters) {
|
|
32
|
+
if (match(filter, endpoint)) {
|
|
33
|
+
unmatchedFilters.delete(filter);
|
|
34
|
+
included = filter.op === 'include';
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return included;
|
|
38
|
+
});
|
|
39
|
+
// Check if any filters didn't match
|
|
40
|
+
const unmatched = Array.from(unmatchedFilters).filter((f) => f.type === 'tool' || f.type === 'resource');
|
|
41
|
+
if (unmatched.length > 0) {
|
|
42
|
+
throw new Error(`The following filters did not match any endpoints: ${unmatched
|
|
43
|
+
.map((f) => `${f.type}=${f.value}`)
|
|
44
|
+
.join(', ')}`);
|
|
45
|
+
}
|
|
46
|
+
return filtered;
|
|
47
|
+
}
|
|
48
|
+
function match({ type, value }, endpoint) {
|
|
49
|
+
switch (type) {
|
|
50
|
+
case 'resource': {
|
|
51
|
+
const regexStr = '^' + normalizeResource(value).replace(/\*/g, '.*') + '$';
|
|
52
|
+
const regex = new RegExp(regexStr);
|
|
53
|
+
return regex.test(normalizeResource(endpoint.metadata.resource));
|
|
54
|
+
}
|
|
55
|
+
case 'operation':
|
|
56
|
+
return endpoint.metadata.operation === value;
|
|
57
|
+
case 'tag':
|
|
58
|
+
return endpoint.metadata.tags.includes(value);
|
|
59
|
+
case 'tool':
|
|
60
|
+
return endpoint.tool.name === value;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
function normalizeResource(resource) {
|
|
64
|
+
return resource.toLowerCase().replace(/[^a-z.*\-_]*/g, '');
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/tools/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAM/E,YAAY;OACZ,QAAQ;OACR,YAAY;OACZ,QAAQ;OACR,YAAY;OACZ,cAAc;OACd,eAAe;OACf,YAAY;OACZ,mBAAmB;OACnB,iBAAiB;AAExB,MAAM,CAAC,MAAM,SAAS,GAAe,EAAE,CAAC;AAExC,SAAS,WAAW,CAAC,QAAkB;IACrC,SAAS,CAAC,IAAI,CAAC,QAAQ,C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@
|
|
|
1
|
+
import { Metadata } from '@beeper/desktop-mcp/tools/types';
|
|
2
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
+
import BeeperDesktop from '@beeper/desktop-api';
|
|
4
|
+
export declare const metadata: Metadata;
|
|
5
|
+
export declare const tool: Tool;
|
|
6
|
+
export declare const handler: (client: BeeperDesktop, args: Record<string, unknown> | undefined) => Promise<import("@beeper/desktop-mcp/tools/types").ToolCallResult>;
|
|
7
|
+
declare const _default: {
|
|
8
|
+
metadata: Metadata;
|
|
9
|
+
tool: {
|
|
10
|
+
[x: string]: unknown;
|
|
11
|
+
name: string;
|
|
12
|
+
inputSchema: {
|
|
13
|
+
[x: string]: unknown;
|
|
14
|
+
type: "object";
|
|
15
|
+
properties?: {
|
|
16
|
+
[x: string]: unknown;
|
|
17
|
+
} | undefined;
|
|
18
|
+
required?: string[] | undefined;
|
|
19
|
+
};
|
|
20
|
+
title?: string | undefined;
|
|
21
|
+
description?: string | undefined;
|
|
22
|
+
outputSchema?: {
|
|
23
|
+
[x: string]: unknown;
|
|
24
|
+
type: "object";
|
|
25
|
+
properties?: {
|
|
26
|
+
[x: string]: unknown;
|
|
27
|
+
} | undefined;
|
|
28
|
+
required?: string[] | undefined;
|
|
29
|
+
} | undefined;
|
|
30
|
+
annotations?: {
|
|
31
|
+
[x: string]: unknown;
|
|
32
|
+
title?: string | undefined;
|
|
33
|
+
readOnlyHint?: boolean | undefined;
|
|
34
|
+
destructiveHint?: boolean | undefined;
|
|
35
|
+
idempotentHint?: boolean | undefined;
|
|
36
|
+
openWorldHint?: boolean | undefined;
|
|
37
|
+
} | undefined;
|
|
38
|
+
_meta?: {
|
|
39
|
+
[x: string]: unknown;
|
|
40
|
+
} | undefined;
|
|
41
|
+
};
|
|
42
|
+
handler: (client: BeeperDesktop, args: Record<string, unknown> | undefined) => Promise<import("@beeper/desktop-mcp/tools/types").ToolCallResult>;
|
|
43
|
+
};
|
|
44
|
+
export default _default;
|
|
45
|
+
//# sourceMappingURL=get-attachment.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-attachment.d.mts","sourceRoot":"","sources":["../../src/tools/messages/get-attachment.ts"],"names":[],"mappings":"OAEO,EAAE,QAAQ,EAAuB,MAAM,iCAAiC;OAExE,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,aAAa,MAAM,qBAAqB;AAE/C,eAAO,MAAM,QAAQ,EAAE,QAOtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IAkBlB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,QAAQ,aAAa,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,sEAG7F,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAHoC,aAAa,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAK9F,wBAA2C"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Metadata } from '@beeper/desktop-mcp/tools/types';
|
|
2
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
+
import BeeperDesktop from '@beeper/desktop-api';
|
|
4
|
+
export declare const metadata: Metadata;
|
|
5
|
+
export declare const tool: Tool;
|
|
6
|
+
export declare const handler: (client: BeeperDesktop, args: Record<string, unknown> | undefined) => Promise<import("@beeper/desktop-mcp/tools/types").ToolCallResult>;
|
|
7
|
+
declare const _default: {
|
|
8
|
+
metadata: Metadata;
|
|
9
|
+
tool: {
|
|
10
|
+
[x: string]: unknown;
|
|
11
|
+
name: string;
|
|
12
|
+
inputSchema: {
|
|
13
|
+
[x: string]: unknown;
|
|
14
|
+
type: "object";
|
|
15
|
+
properties?: {
|
|
16
|
+
[x: string]: unknown;
|
|
17
|
+
} | undefined;
|
|
18
|
+
required?: string[] | undefined;
|
|
19
|
+
};
|
|
20
|
+
title?: string | undefined;
|
|
21
|
+
description?: string | undefined;
|
|
22
|
+
outputSchema?: {
|
|
23
|
+
[x: string]: unknown;
|
|
24
|
+
type: "object";
|
|
25
|
+
properties?: {
|
|
26
|
+
[x: string]: unknown;
|
|
27
|
+
} | undefined;
|
|
28
|
+
required?: string[] | undefined;
|
|
29
|
+
} | undefined;
|
|
30
|
+
annotations?: {
|
|
31
|
+
[x: string]: unknown;
|
|
32
|
+
title?: string | undefined;
|
|
33
|
+
readOnlyHint?: boolean | undefined;
|
|
34
|
+
destructiveHint?: boolean | undefined;
|
|
35
|
+
idempotentHint?: boolean | undefined;
|
|
36
|
+
openWorldHint?: boolean | undefined;
|
|
37
|
+
} | undefined;
|
|
38
|
+
_meta?: {
|
|
39
|
+
[x: string]: unknown;
|
|
40
|
+
} | undefined;
|
|
41
|
+
};
|
|
42
|
+
handler: (client: BeeperDesktop, args: Record<string, unknown> | undefined) => Promise<import("@beeper/desktop-mcp/tools/types").ToolCallResult>;
|
|
43
|
+
};
|
|
44
|
+
export default _default;
|
|
45
|
+
//# sourceMappingURL=get-attachment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-attachment.d.ts","sourceRoot":"","sources":["../../src/tools/messages/get-attachment.ts"],"names":[],"mappings":"OAEO,EAAE,QAAQ,EAAuB,MAAM,iCAAiC;OAExE,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,aAAa,MAAM,qBAAqB;AAE/C,eAAO,MAAM,QAAQ,EAAE,QAOtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IAkBlB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,QAAQ,aAAa,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,sEAG7F,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAHoC,aAAa,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAK9F,wBAA2C"}
|
|
@@ -0,0 +1,39 @@
|
|
|
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.handler = exports.tool = exports.metadata = void 0;
|
|
5
|
+
const types_1 = require("@beeper/desktop-mcp/tools/types");
|
|
6
|
+
exports.metadata = {
|
|
7
|
+
resource: 'messages',
|
|
8
|
+
operation: 'write',
|
|
9
|
+
tags: ['messages'],
|
|
10
|
+
httpMethod: 'post',
|
|
11
|
+
httpPath: '/v0/get-attachment',
|
|
12
|
+
operationId: 'get_attachment',
|
|
13
|
+
};
|
|
14
|
+
exports.tool = {
|
|
15
|
+
name: 'get_attachment',
|
|
16
|
+
description: 'Download a message attachment and return the local file path.',
|
|
17
|
+
inputSchema: {
|
|
18
|
+
type: 'object',
|
|
19
|
+
properties: {
|
|
20
|
+
chatID: {
|
|
21
|
+
type: 'string',
|
|
22
|
+
description: 'Unique identifier of the chat (supports both chatID and localChatID).',
|
|
23
|
+
},
|
|
24
|
+
messageID: {
|
|
25
|
+
type: 'string',
|
|
26
|
+
description: 'The message ID (eventID) containing the attachment.',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
required: ['chatID', 'messageID'],
|
|
30
|
+
},
|
|
31
|
+
annotations: {},
|
|
32
|
+
};
|
|
33
|
+
const handler = async (client, args) => {
|
|
34
|
+
const body = args;
|
|
35
|
+
return (0, types_1.asTextContentResult)(await client.messages.getAttachment(body));
|
|
36
|
+
};
|
|
37
|
+
exports.handler = handler;
|
|
38
|
+
exports.default = { metadata: exports.metadata, tool: exports.tool, handler: exports.handler };
|
|
39
|
+
//# sourceMappingURL=get-attachment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-attachment.js","sourceRoot":"","sources":["../../src/tools/messages/get-attachment.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,2DAAgF;AAKnE,QAAA,QAAQ,GAAa;IAChC,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE,MAAM;IAClB,QAAQ,EAAE,oBAAoB;IAC9B,WAAW,EAAE,gBAAgB;CAC9B,CAAC;AAEW,QAAA,IAAI,GAAS;IACxB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,+DAA+D;IAC5E,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,uEAAuE;aACrF;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,qDAAqD;aACnE;SACF;QACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC;KAClC;IACD,WAAW,EAAE,EAAE;CAChB,CAAC;AAEK,MAAM,OAAO,GAAG,KAAK,EAAE,MAAqB,EAAE,IAAyC,EAAE,EAAE;IAChG,MAAM,IAAI,GAAG,IAAW,CAAC;IACzB,OAAO,IAAA,2BAAmB,EAAC,MAAM,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;AACxE,CAAC,CAAC;AAHW,QAAA,OAAO,WAGlB;AAEF,kBAAe,EAAE,QAAQ,EAAR,gBAAQ,EAAE,IAAI,EAAJ,YAAI,EAAE,OAAO,EAAP,eAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { asTextContentResult } from '@beeper/desktop-mcp/tools/types';
|
|
3
|
+
export const metadata = {
|
|
4
|
+
resource: 'messages',
|
|
5
|
+
operation: 'write',
|
|
6
|
+
tags: ['messages'],
|
|
7
|
+
httpMethod: 'post',
|
|
8
|
+
httpPath: '/v0/get-attachment',
|
|
9
|
+
operationId: 'get_attachment',
|
|
10
|
+
};
|
|
11
|
+
export const tool = {
|
|
12
|
+
name: 'get_attachment',
|
|
13
|
+
description: 'Download a message attachment and return the local file path.',
|
|
14
|
+
inputSchema: {
|
|
15
|
+
type: 'object',
|
|
16
|
+
properties: {
|
|
17
|
+
chatID: {
|
|
18
|
+
type: 'string',
|
|
19
|
+
description: 'Unique identifier of the chat (supports both chatID and localChatID).',
|
|
20
|
+
},
|
|
21
|
+
messageID: {
|
|
22
|
+
type: 'string',
|
|
23
|
+
description: 'The message ID (eventID) containing the attachment.',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
required: ['chatID', 'messageID'],
|
|
27
|
+
},
|
|
28
|
+
annotations: {},
|
|
29
|
+
};
|
|
30
|
+
export const handler = async (client, args) => {
|
|
31
|
+
const body = args;
|
|
32
|
+
return asTextContentResult(await client.messages.getAttachment(body));
|
|
33
|
+
};
|
|
34
|
+
export default { metadata, tool, handler };
|
|
35
|
+
//# sourceMappingURL=get-attachment.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-attachment.mjs","sourceRoot":"","sources":["../../src/tools/messages/get-attachment.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAY,mBAAmB,EAAE,MAAM,iCAAiC;AAK/E,MAAM,CAAC,MAAM,QAAQ,GAAa;IAChC,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE,MAAM;IAClB,QAAQ,EAAE,oBAAoB;IAC9B,WAAW,EAAE,gBAAgB;CAC9B,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAAS;IACxB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,+DAA+D;IAC5E,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,uEAAuE;aACrF;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,qDAAqD;aACnE;SACF;QACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC;KAClC;IACD,WAAW,EAAE,EAAE;CAChB,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,EAAE,MAAqB,EAAE,IAAyC,EAAE,EAAE;IAChG,MAAM,IAAI,GAAG,IAAW,CAAC;IACzB,OAAO,mBAAmB,CAAC,MAAM,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;AACxE,CAAC,CAAC;AAEF,eAAe,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Metadata } from '@beeper/desktop-mcp/tools/types';
|
|
2
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
+
import BeeperDesktop from '@beeper/desktop-api';
|
|
4
|
+
export declare const metadata: Metadata;
|
|
5
|
+
export declare const tool: Tool;
|
|
6
|
+
export declare const handler: (client: BeeperDesktop, args: Record<string, unknown> | undefined) => Promise<import("@beeper/desktop-mcp/tools/types").ToolCallResult>;
|
|
7
|
+
declare const _default: {
|
|
8
|
+
metadata: Metadata;
|
|
9
|
+
tool: {
|
|
10
|
+
[x: string]: unknown;
|
|
11
|
+
name: string;
|
|
12
|
+
inputSchema: {
|
|
13
|
+
[x: string]: unknown;
|
|
14
|
+
type: "object";
|
|
15
|
+
properties?: {
|
|
16
|
+
[x: string]: unknown;
|
|
17
|
+
} | undefined;
|
|
18
|
+
required?: string[] | undefined;
|
|
19
|
+
};
|
|
20
|
+
title?: string | undefined;
|
|
21
|
+
description?: string | undefined;
|
|
22
|
+
outputSchema?: {
|
|
23
|
+
[x: string]: unknown;
|
|
24
|
+
type: "object";
|
|
25
|
+
properties?: {
|
|
26
|
+
[x: string]: unknown;
|
|
27
|
+
} | undefined;
|
|
28
|
+
required?: string[] | undefined;
|
|
29
|
+
} | undefined;
|
|
30
|
+
annotations?: {
|
|
31
|
+
[x: string]: unknown;
|
|
32
|
+
title?: string | undefined;
|
|
33
|
+
readOnlyHint?: boolean | undefined;
|
|
34
|
+
destructiveHint?: boolean | undefined;
|
|
35
|
+
idempotentHint?: boolean | undefined;
|
|
36
|
+
openWorldHint?: boolean | undefined;
|
|
37
|
+
} | undefined;
|
|
38
|
+
_meta?: {
|
|
39
|
+
[x: string]: unknown;
|
|
40
|
+
} | undefined;
|
|
41
|
+
};
|
|
42
|
+
handler: (client: BeeperDesktop, args: Record<string, unknown> | undefined) => Promise<import("@beeper/desktop-mcp/tools/types").ToolCallResult>;
|
|
43
|
+
};
|
|
44
|
+
export default _default;
|
|
45
|
+
//# sourceMappingURL=search-messages.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-messages.d.mts","sourceRoot":"","sources":["../../src/tools/messages/search-messages.ts"],"names":[],"mappings":"OAEO,EAAE,QAAQ,EAAuB,MAAM,iCAAiC;OAExE,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,aAAa,MAAM,qBAAqB;AAE/C,eAAO,MAAM,QAAQ,EAAE,QAOtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IA4GlB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,QAAQ,aAAa,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,sEAI7F,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAJoC,aAAa,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAM9F,wBAA2C"}
|