@beeper/desktop-mcp 0.1.5 → 4.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -14
- package/docs-search-tool.d.mts +44 -0
- package/docs-search-tool.d.mts.map +1 -0
- package/docs-search-tool.d.ts +44 -0
- package/docs-search-tool.d.ts.map +1 -0
- package/docs-search-tool.js +43 -0
- package/docs-search-tool.js.map +1 -0
- package/docs-search-tool.mjs +39 -0
- package/docs-search-tool.mjs.map +1 -0
- package/handlers/get-accounts.d.mts +3 -0
- package/handlers/get-accounts.d.mts.map +1 -0
- package/handlers/get-accounts.d.ts +3 -0
- package/handlers/get-accounts.d.ts.map +1 -0
- package/handlers/get-accounts.js +32 -0
- package/handlers/get-accounts.js.map +1 -0
- package/handlers/get-accounts.mjs +28 -0
- package/handlers/get-accounts.mjs.map +1 -0
- package/handlers/get-chat.d.mts +3 -0
- package/handlers/get-chat.d.mts.map +1 -0
- package/handlers/get-chat.d.ts +3 -0
- package/handlers/get-chat.d.ts.map +1 -0
- package/handlers/get-chat.js +20 -0
- package/handlers/get-chat.js.map +1 -0
- package/handlers/get-chat.mjs +16 -0
- package/handlers/get-chat.mjs.map +1 -0
- package/handlers/index.d.mts +3 -0
- package/handlers/index.d.mts.map +1 -0
- package/handlers/index.d.ts +3 -0
- package/handlers/index.d.ts.map +1 -0
- package/handlers/index.js +30 -0
- package/handlers/index.js.map +1 -0
- package/handlers/index.mjs +27 -0
- package/handlers/index.mjs.map +1 -0
- package/handlers/list-chats.d.mts +3 -0
- package/handlers/list-chats.d.mts.map +1 -0
- package/handlers/list-chats.d.ts +3 -0
- package/handlers/list-chats.d.ts.map +1 -0
- package/handlers/list-chats.js +46 -0
- package/handlers/list-chats.js.map +1 -0
- package/handlers/list-chats.mjs +42 -0
- package/handlers/list-chats.mjs.map +1 -0
- package/handlers/list-messages.d.mts +3 -0
- package/handlers/list-messages.d.mts.map +1 -0
- package/handlers/list-messages.d.ts +3 -0
- package/handlers/list-messages.d.ts.map +1 -0
- package/handlers/list-messages.js +34 -0
- package/handlers/list-messages.js.map +1 -0
- package/handlers/list-messages.mjs +30 -0
- package/handlers/list-messages.mjs.map +1 -0
- package/handlers/open-app.d.mts +3 -0
- package/handlers/open-app.d.mts.map +1 -0
- package/handlers/open-app.d.ts +3 -0
- package/handlers/open-app.d.ts.map +1 -0
- package/handlers/open-app.js +26 -0
- package/handlers/open-app.js.map +1 -0
- package/handlers/open-app.mjs +22 -0
- package/handlers/open-app.mjs.map +1 -0
- package/handlers/search-chats.d.mts +3 -0
- package/handlers/search-chats.d.mts.map +1 -0
- package/handlers/search-chats.d.ts +3 -0
- package/handlers/search-chats.d.ts.map +1 -0
- package/handlers/search-chats.js +38 -0
- package/handlers/search-chats.js.map +1 -0
- package/handlers/search-chats.mjs +34 -0
- package/handlers/search-chats.mjs.map +1 -0
- package/handlers/search-messages.d.mts +3 -0
- package/handlers/search-messages.d.mts.map +1 -0
- package/handlers/search-messages.d.ts +3 -0
- package/handlers/search-messages.d.ts.map +1 -0
- package/handlers/search-messages.js +11 -0
- package/handlers/search-messages.js.map +1 -0
- package/handlers/search-messages.mjs +7 -0
- package/handlers/search-messages.mjs.map +1 -0
- package/handlers/search.d.mts +3 -0
- package/handlers/search.d.mts.map +1 -0
- package/handlers/search.d.ts +3 -0
- package/handlers/search.d.ts.map +1 -0
- package/handlers/search.js +29 -0
- package/handlers/search.js.map +1 -0
- package/handlers/search.mjs +25 -0
- package/handlers/search.mjs.map +1 -0
- package/handlers/send-message.d.mts +3 -0
- package/handlers/send-message.d.mts.map +1 -0
- package/handlers/send-message.d.ts +3 -0
- package/handlers/send-message.d.ts.map +1 -0
- package/handlers/send-message.js +20 -0
- package/handlers/send-message.js.map +1 -0
- package/handlers/send-message.mjs +16 -0
- package/handlers/send-message.mjs.map +1 -0
- package/handlers/utils.d.mts +29 -0
- package/handlers/utils.d.mts.map +1 -0
- package/handlers/utils.d.ts +29 -0
- package/handlers/utils.d.ts.map +1 -0
- package/handlers/utils.js +296 -0
- package/handlers/utils.js.map +1 -0
- package/handlers/utils.mjs +282 -0
- package/handlers/utils.mjs.map +1 -0
- package/http.d.mts +6 -0
- package/http.d.mts.map +1 -1
- package/http.d.ts +6 -0
- package/http.d.ts.map +1 -1
- package/http.js +7 -4
- package/http.js.map +1 -1
- package/http.mjs +3 -3
- package/http.mjs.map +1 -1
- package/options.d.mts +1 -0
- package/options.d.mts.map +1 -1
- package/options.d.ts +1 -0
- package/options.d.ts.map +1 -1
- package/options.js +13 -6
- package/options.js.map +1 -1
- package/options.mjs +13 -6
- package/options.mjs.map +1 -1
- package/package.json +23 -2
- package/server.d.mts.map +1 -1
- package/server.d.ts.map +1 -1
- package/server.js +8 -4
- package/server.js.map +1 -1
- package/server.mjs +8 -4
- package/server.mjs.map +1 -1
- package/src/docs-search-tool.ts +48 -0
- package/src/handlers/get-accounts.ts +28 -0
- package/src/handlers/get-chat.ts +18 -0
- package/src/handlers/index.ts +29 -0
- package/src/handlers/list-chats.ts +47 -0
- package/src/handlers/list-messages.ts +33 -0
- package/src/handlers/open-app.ts +20 -0
- package/src/handlers/search-chats.ts +39 -0
- package/src/handlers/search-messages.ts +8 -0
- package/src/handlers/search.ts +24 -0
- package/src/handlers/send-message.ts +17 -0
- package/src/handlers/utils.ts +381 -0
- package/src/http.ts +3 -3
- package/src/options.ts +17 -7
- package/src/server.ts +8 -5
- package/src/tools/accounts/get-accounts.ts +3 -3
- package/src/tools/chats/archive-chat.ts +6 -6
- package/src/tools/chats/get-chat.ts +6 -7
- package/src/tools/chats/reminders/clear-chat-reminder.ts +10 -8
- package/src/tools/chats/reminders/set-chat-reminder.ts +6 -5
- package/src/tools/chats/search-chats.ts +5 -5
- package/src/tools/index.ts +8 -5
- package/src/tools/messages/list-messages.ts +51 -0
- package/src/tools/messages/search-messages.ts +6 -7
- package/src/tools/messages/send-message.ts +5 -5
- package/src/tools/{app/open-in-app.ts → top-level/focus-app.ts} +6 -6
- package/src/tools/{app → top-level}/search.ts +3 -3
- package/tools/accounts/get-accounts.js +3 -3
- package/tools/accounts/get-accounts.js.map +1 -1
- package/tools/accounts/get-accounts.mjs +3 -3
- package/tools/accounts/get-accounts.mjs.map +1 -1
- package/tools/chats/archive-chat.d.mts.map +1 -1
- package/tools/chats/archive-chat.d.ts.map +1 -1
- package/tools/chats/archive-chat.js +6 -5
- package/tools/chats/archive-chat.js.map +1 -1
- package/tools/chats/archive-chat.mjs +6 -5
- package/tools/chats/archive-chat.mjs.map +1 -1
- package/tools/chats/get-chat.d.mts.map +1 -1
- package/tools/chats/get-chat.d.ts.map +1 -1
- package/tools/chats/get-chat.js +6 -6
- package/tools/chats/get-chat.js.map +1 -1
- package/tools/chats/get-chat.mjs +6 -6
- package/tools/chats/get-chat.mjs.map +1 -1
- package/tools/chats/reminders/clear-chat-reminder.d.mts.map +1 -1
- package/tools/chats/reminders/clear-chat-reminder.d.ts.map +1 -1
- package/tools/chats/reminders/clear-chat-reminder.js +10 -7
- package/tools/chats/reminders/clear-chat-reminder.js.map +1 -1
- package/tools/chats/reminders/clear-chat-reminder.mjs +10 -7
- package/tools/chats/reminders/clear-chat-reminder.mjs.map +1 -1
- package/tools/chats/reminders/set-chat-reminder.d.mts.map +1 -1
- package/tools/chats/reminders/set-chat-reminder.d.ts.map +1 -1
- package/tools/chats/reminders/set-chat-reminder.js +6 -5
- package/tools/chats/reminders/set-chat-reminder.js.map +1 -1
- package/tools/chats/reminders/set-chat-reminder.mjs +6 -5
- package/tools/chats/reminders/set-chat-reminder.mjs.map +1 -1
- package/tools/chats/search-chats.js +5 -5
- package/tools/chats/search-chats.js.map +1 -1
- package/tools/chats/search-chats.mjs +5 -5
- package/tools/chats/search-chats.mjs.map +1 -1
- package/tools/index.d.mts.map +1 -1
- package/tools/index.d.ts.map +1 -1
- package/tools/index.js +8 -5
- package/tools/index.js.map +1 -1
- package/tools/index.mjs +8 -5
- package/tools/index.mjs.map +1 -1
- package/tools/messages/list-messages.d.mts +45 -0
- package/tools/messages/list-messages.d.mts.map +1 -0
- package/tools/messages/list-messages.d.ts +45 -0
- package/tools/messages/list-messages.d.ts.map +1 -0
- package/tools/messages/list-messages.js +47 -0
- package/tools/messages/list-messages.js.map +1 -0
- package/tools/messages/list-messages.mjs +43 -0
- package/tools/messages/list-messages.mjs.map +1 -0
- package/tools/messages/search-messages.d.mts.map +1 -1
- package/tools/messages/search-messages.d.ts.map +1 -1
- package/tools/messages/search-messages.js +6 -6
- package/tools/messages/search-messages.js.map +1 -1
- package/tools/messages/search-messages.mjs +6 -6
- package/tools/messages/search-messages.mjs.map +1 -1
- package/tools/messages/send-message.js +5 -5
- package/tools/messages/send-message.js.map +1 -1
- package/tools/messages/send-message.mjs +5 -5
- package/tools/messages/send-message.mjs.map +1 -1
- package/tools/{app/open-in-app.d.ts → top-level/focus-app.d.mts} +1 -1
- package/tools/top-level/focus-app.d.mts.map +1 -0
- package/tools/{app/open-in-app.d.mts → top-level/focus-app.d.ts} +1 -1
- package/tools/top-level/focus-app.d.ts.map +1 -0
- package/tools/{app/open-in-app.js → top-level/focus-app.js} +7 -7
- package/tools/top-level/focus-app.js.map +1 -0
- package/tools/{app/open-in-app.mjs → top-level/focus-app.mjs} +7 -7
- package/tools/top-level/focus-app.mjs.map +1 -0
- package/tools/top-level/search.d.mts.map +1 -0
- package/tools/top-level/search.d.ts.map +1 -0
- package/tools/{app → top-level}/search.js +3 -3
- package/tools/top-level/search.js.map +1 -0
- package/tools/{app → top-level}/search.mjs +3 -3
- package/tools/top-level/search.mjs.map +1 -0
- package/tools/app/open-in-app.d.mts.map +0 -1
- package/tools/app/open-in-app.d.ts.map +0 -1
- package/tools/app/open-in-app.js.map +0 -1
- package/tools/app/open-in-app.mjs.map +0 -1
- package/tools/app/search.d.mts.map +0 -1
- package/tools/app/search.d.ts.map +0 -1
- package/tools/app/search.js.map +0 -1
- package/tools/app/search.mjs.map +0 -1
- /package/tools/{app → top-level}/search.d.mts +0 -0
- /package/tools/{app → top-level}/search.d.ts +0 -0
package/server.mjs
CHANGED
|
@@ -6,11 +6,12 @@ import BeeperDesktop from '@beeper/desktop-api';
|
|
|
6
6
|
import { applyCompatibilityTransformations, defaultClientCapabilities, knownClients, parseEmbeddedJSON, } from "./compat.mjs";
|
|
7
7
|
import { dynamicTools } from "./dynamic-tools.mjs";
|
|
8
8
|
import { codeTool } from "./code-tool.mjs";
|
|
9
|
+
import docsSearchTool from "./docs-search-tool.mjs";
|
|
9
10
|
export { ClientType } from "./compat.mjs";
|
|
10
11
|
export { endpoints } from "./tools.mjs";
|
|
11
12
|
export const newMcpServer = () => new McpServer({
|
|
12
13
|
name: 'beeper_desktop_api_api',
|
|
13
|
-
version: '
|
|
14
|
+
version: '4.2.1',
|
|
14
15
|
}, {
|
|
15
16
|
capabilities: { tools: {}, logging: {} },
|
|
16
17
|
instructions: 'Access to all chats and messages across networks using Beeper Desktop. Can be used to find, get, send, and manage messages and chats.',
|
|
@@ -107,7 +108,7 @@ export function initMcpServer(params) {
|
|
|
107
108
|
*/
|
|
108
109
|
export async function selectTools(endpoints, options) {
|
|
109
110
|
const filteredEndpoints = query(options?.filters ?? [], endpoints);
|
|
110
|
-
let includedTools = filteredEndpoints;
|
|
111
|
+
let includedTools = filteredEndpoints.slice();
|
|
111
112
|
if (includedTools.length > 0) {
|
|
112
113
|
if (options?.includeDynamicTools) {
|
|
113
114
|
includedTools = dynamicTools(includedTools);
|
|
@@ -115,7 +116,7 @@ export async function selectTools(endpoints, options) {
|
|
|
115
116
|
}
|
|
116
117
|
else {
|
|
117
118
|
if (options?.includeAllTools) {
|
|
118
|
-
includedTools = endpoints;
|
|
119
|
+
includedTools = endpoints.slice();
|
|
119
120
|
}
|
|
120
121
|
else if (options?.includeDynamicTools) {
|
|
121
122
|
includedTools = dynamicTools(endpoints);
|
|
@@ -124,9 +125,12 @@ export async function selectTools(endpoints, options) {
|
|
|
124
125
|
includedTools = [await codeTool()];
|
|
125
126
|
}
|
|
126
127
|
else {
|
|
127
|
-
includedTools = endpoints;
|
|
128
|
+
includedTools = endpoints.slice();
|
|
128
129
|
}
|
|
129
130
|
}
|
|
131
|
+
if (options?.includeDocsTools ?? true) {
|
|
132
|
+
includedTools.push(docsSearchTool);
|
|
133
|
+
}
|
|
130
134
|
const capabilities = { ...defaultClientCapabilities, ...options?.capabilities };
|
|
131
135
|
return applyCompatibilityTransformations(includedTools, capabilities);
|
|
132
136
|
}
|
package/server.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.mjs","sourceRoot":"","sources":["src/server.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAG/E,EAAE,SAAS,EAAE,MAAM,yCAAyC;OAC5D,EAAY,SAAS,EAAmB,KAAK,EAAE;OAC/C,EACL,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,GAGtB,MAAM,oCAAoC;OAEpC,aAAa,MAAM,qBAAqB;OACxC,EACL,iCAAiC,EAEjC,yBAAyB,EACzB,YAAY,EACZ,iBAAiB,GAClB;OACM,EAAE,YAAY,EAAE;OAChB,EAAE,QAAQ,EAAE;
|
|
1
|
+
{"version":3,"file":"server.mjs","sourceRoot":"","sources":["src/server.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAG/E,EAAE,SAAS,EAAE,MAAM,yCAAyC;OAC5D,EAAY,SAAS,EAAmB,KAAK,EAAE;OAC/C,EACL,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,GAGtB,MAAM,oCAAoC;OAEpC,aAAa,MAAM,qBAAqB;OACxC,EACL,iCAAiC,EAEjC,yBAAyB,EACzB,YAAY,EACZ,iBAAiB,GAClB;OACM,EAAE,YAAY,EAAE;OAChB,EAAE,QAAQ,EAAE;OACZ,cAAc;OAId,EAAE,UAAU,EAAE;OAGd,EAAE,SAAS,EAAE;AAEpB,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE,CAC/B,IAAI,SAAS,CACX;IACE,IAAI,EAAE,wBAAwB;IAC9B,OAA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metadata, asTextContentResult } from './tools/types';
|
|
4
|
+
|
|
5
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
6
|
+
|
|
7
|
+
export const metadata: Metadata = {
|
|
8
|
+
resource: 'all',
|
|
9
|
+
operation: 'read',
|
|
10
|
+
tags: [],
|
|
11
|
+
httpMethod: 'get',
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const tool: Tool = {
|
|
15
|
+
name: 'search_docs',
|
|
16
|
+
description:
|
|
17
|
+
'Search for documentation for how to use the client to interact with the API.\nThe tool will return an array of Markdown-formatted documentation pages.',
|
|
18
|
+
inputSchema: {
|
|
19
|
+
type: 'object',
|
|
20
|
+
properties: {
|
|
21
|
+
query: {
|
|
22
|
+
type: 'string',
|
|
23
|
+
description: 'The query to search for.',
|
|
24
|
+
},
|
|
25
|
+
language: {
|
|
26
|
+
type: 'string',
|
|
27
|
+
description: 'The language for the SDK to search for.',
|
|
28
|
+
enum: ['http', 'python', 'go', 'typescript', 'terraform', 'ruby', 'java', 'kotlin'],
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
required: ['query', 'language'],
|
|
32
|
+
},
|
|
33
|
+
annotations: {
|
|
34
|
+
readOnlyHint: true,
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const docsSearchURL =
|
|
39
|
+
process.env['DOCS_SEARCH_URL'] || 'https://api.stainless.com/api/projects/beeper-desktop-api/docs/search';
|
|
40
|
+
|
|
41
|
+
export const handler = async (_: unknown, args: Record<string, unknown> | undefined) => {
|
|
42
|
+
const body = args as any;
|
|
43
|
+
const query = new URLSearchParams(body).toString();
|
|
44
|
+
const result = await fetch(`${docsSearchURL}?${query}`);
|
|
45
|
+
return asTextContentResult(await result.json());
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export default { metadata, tool, handler };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { HandlerFunction } from '../tools/types';
|
|
2
|
+
import { asMarkdownContentResult } from './utils';
|
|
3
|
+
|
|
4
|
+
export const handler: HandlerFunction = async (client) => {
|
|
5
|
+
const accounts = await client.accounts.list();
|
|
6
|
+
if (!accounts || accounts.length === 0)
|
|
7
|
+
throw new Error('No accounts found. This should never happen, please contact help@beeper.com.');
|
|
8
|
+
const lines: string[] = [];
|
|
9
|
+
lines.push('# Accounts');
|
|
10
|
+
for (const acc of accounts) {
|
|
11
|
+
if (!acc.user) {
|
|
12
|
+
lines.push(`\n## ${acc.network}`);
|
|
13
|
+
lines.push(`**Account ID**: \`${acc.accountID}\``);
|
|
14
|
+
lines.push('**User**: Unknown');
|
|
15
|
+
continue;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const name = acc.user.fullName || acc.user.username || acc.user.id;
|
|
19
|
+
lines.push(`\n## ${acc.network}`);
|
|
20
|
+
lines.push(`**Account ID**: \`${acc.accountID}\``);
|
|
21
|
+
lines.push(`**User**: ${name}`);
|
|
22
|
+
if (acc.user.email) lines.push(`**Email**: ${acc.user.email}`);
|
|
23
|
+
if (acc.user.phoneNumber) lines.push(`**Phone**: ${acc.user.phoneNumber}`);
|
|
24
|
+
}
|
|
25
|
+
lines.push('\n# Using this information\n');
|
|
26
|
+
lines.push('- Pass accountIDs to narrow chat/message queries when known.');
|
|
27
|
+
return asMarkdownContentResult(lines);
|
|
28
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { HandlerFunction } from '../tools/types';
|
|
2
|
+
import { asMarkdownContentResult, formatChatToMarkdown } from './utils';
|
|
3
|
+
|
|
4
|
+
export const handler: HandlerFunction = async (client, args) => {
|
|
5
|
+
const { chatID, ...queryParams } = args as any;
|
|
6
|
+
const chat = await client.chats.retrieve(chatID, queryParams);
|
|
7
|
+
|
|
8
|
+
const lines: string[] = [];
|
|
9
|
+
if (!chat) {
|
|
10
|
+
lines.push('Chat not found.');
|
|
11
|
+
return asMarkdownContentResult(lines);
|
|
12
|
+
}
|
|
13
|
+
lines.push(formatChatToMarkdown(chat, undefined));
|
|
14
|
+
lines.push('\n# Using this information\n');
|
|
15
|
+
lines.push('- Use search_messages to find specific content in this chat.');
|
|
16
|
+
lines.push('- Link the "open" link to the user to allow them to view the chat in Beeper Desktop.');
|
|
17
|
+
return asMarkdownContentResult(lines);
|
|
18
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Endpoint, HandlerFunction } from '../tools';
|
|
2
|
+
|
|
3
|
+
import { handler as get_accounts } from './get-accounts';
|
|
4
|
+
import { handler as open_in_app } from './open-app';
|
|
5
|
+
import { handler as search } from './search';
|
|
6
|
+
import { handler as get_chat } from './get-chat';
|
|
7
|
+
import { handler as search_chats } from './search-chats';
|
|
8
|
+
import { handler as search_messages } from './search-messages';
|
|
9
|
+
import { handler as send_message } from './send-message';
|
|
10
|
+
|
|
11
|
+
const HANDLER_OVERRIDES: Record<string, HandlerFunction> = {
|
|
12
|
+
get_accounts,
|
|
13
|
+
open_in_app,
|
|
14
|
+
focus_app: open_in_app,
|
|
15
|
+
search,
|
|
16
|
+
get_chat,
|
|
17
|
+
search_chats,
|
|
18
|
+
search_messages,
|
|
19
|
+
send_message,
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export function mapEndpoint(endpoint: Endpoint): Endpoint {
|
|
23
|
+
const handler = HANDLER_OVERRIDES[endpoint.tool.name];
|
|
24
|
+
if (!handler) return endpoint;
|
|
25
|
+
return {
|
|
26
|
+
...endpoint,
|
|
27
|
+
handler,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { HandlerFunction } from '../tools/types';
|
|
2
|
+
import { asMarkdownContentResult, formatChatToMarkdown } from './utils';
|
|
3
|
+
|
|
4
|
+
export const handler: HandlerFunction = async (client, args) => {
|
|
5
|
+
const body = args as any;
|
|
6
|
+
const output = await client.chats.search(body);
|
|
7
|
+
|
|
8
|
+
const lines: string[] = [];
|
|
9
|
+
lines.push('# Chats');
|
|
10
|
+
|
|
11
|
+
const items = output.items || [];
|
|
12
|
+
const hasMore = !!output.hasMore;
|
|
13
|
+
|
|
14
|
+
if (hasMore) {
|
|
15
|
+
lines.push(`\nShowing ${items.length} chats (more available)`);
|
|
16
|
+
if (output.oldestCursor) {
|
|
17
|
+
lines.push(`Next page (older): cursor='${output.oldestCursor}', direction='before'`);
|
|
18
|
+
}
|
|
19
|
+
if (output.newestCursor) {
|
|
20
|
+
lines.push(`Previous page (newer): cursor='${output.newestCursor}', direction='after'`);
|
|
21
|
+
}
|
|
22
|
+
} else if (items.length > 0) {
|
|
23
|
+
lines.push(`\nShowing ${items.length} chat${items.length === 1 ? '' : 's'}`);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (items.length === 0) {
|
|
27
|
+
lines.push('\nNo chats found.');
|
|
28
|
+
} else {
|
|
29
|
+
for (const chatWithPreview of items) {
|
|
30
|
+
lines.push(formatChatToMarkdown(chatWithPreview, undefined));
|
|
31
|
+
const preview = (chatWithPreview as any).preview;
|
|
32
|
+
if (preview) {
|
|
33
|
+
lines.push(`**Last message**: ${preview.text || '(no text)'}`);
|
|
34
|
+
if (preview.senderName) {
|
|
35
|
+
lines.push(`**From**: ${preview.senderName}`);
|
|
36
|
+
}
|
|
37
|
+
lines.push(`**Timestamp**: ${preview.timestamp}`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
lines.push('\n# Using this information\n');
|
|
42
|
+
lines.push(
|
|
43
|
+
'- Pass the "chatID" to get_chat or search_messages for details about a chat, or send_message to send a message to a chat.',
|
|
44
|
+
);
|
|
45
|
+
lines.push('- Link the "open" link to the user to allow them to view the chat in Beeper Desktop.');
|
|
46
|
+
return asMarkdownContentResult(lines);
|
|
47
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { asTextContentResult, type HandlerFunction } from '../tools/types';
|
|
2
|
+
import { mapMessagesToText } from './utils';
|
|
3
|
+
|
|
4
|
+
export const handler: HandlerFunction = async (client, args) => {
|
|
5
|
+
const body = args as any;
|
|
6
|
+
const output = await client.messages.search(body);
|
|
7
|
+
|
|
8
|
+
const lines: string[] = [];
|
|
9
|
+
lines.push('# Messages');
|
|
10
|
+
|
|
11
|
+
const items = (output as any).items || [];
|
|
12
|
+
const hasMore = !!(output as any).hasMore;
|
|
13
|
+
|
|
14
|
+
if (hasMore) {
|
|
15
|
+
lines.push(`\nShowing ${items.length} messages (more available)`);
|
|
16
|
+
if ((output as any).oldestCursor) {
|
|
17
|
+
lines.push(`Next page (older): cursor='${(output as any).oldestCursor}', direction='before'`);
|
|
18
|
+
}
|
|
19
|
+
if ((output as any).newestCursor) {
|
|
20
|
+
lines.push(`Previous page (newer): cursor='${(output as any).newestCursor}', direction='after'`);
|
|
21
|
+
}
|
|
22
|
+
} else if (items.length > 0) {
|
|
23
|
+
lines.push(`\nShowing ${items.length} message${items.length === 1 ? '' : 's'}`);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (items.length === 0) {
|
|
27
|
+
lines.push('\nNo messages found.');
|
|
28
|
+
} else {
|
|
29
|
+
lines.push(mapMessagesToText(output as any, body, undefined));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return asTextContentResult(lines.join('\n'));
|
|
33
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { asTextContentResult, type HandlerFunction } from '../tools/types';
|
|
2
|
+
|
|
3
|
+
export const handler: HandlerFunction = async (client, args) => {
|
|
4
|
+
const body = args as any;
|
|
5
|
+
const output = await client.focus(body);
|
|
6
|
+
|
|
7
|
+
const lines: string[] = [];
|
|
8
|
+
if (output.success) {
|
|
9
|
+
lines.push('Beeper was opened.');
|
|
10
|
+
if (body?.chatID) {
|
|
11
|
+
const chatRef = String(body.chatID);
|
|
12
|
+
lines.push(`Focused chat: ${chatRef}`);
|
|
13
|
+
}
|
|
14
|
+
if (body?.draftText) lines.push(`Draft text populated: ${body.draftText}`);
|
|
15
|
+
if (body?.draftAttachmentPath) lines.push(`Draft attachment populated: ${body.draftAttachmentPath}`);
|
|
16
|
+
} else {
|
|
17
|
+
lines.push('Failed to open Beeper.');
|
|
18
|
+
}
|
|
19
|
+
return asTextContentResult(lines.join('\n'));
|
|
20
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { HandlerFunction } from '../tools/types';
|
|
2
|
+
import { asMarkdownContentResult, formatChatToMarkdown } from './utils';
|
|
3
|
+
|
|
4
|
+
export const handler: HandlerFunction = async (client, args) => {
|
|
5
|
+
const body = args as any;
|
|
6
|
+
const output = await client.chats.search(body);
|
|
7
|
+
|
|
8
|
+
const lines: string[] = [];
|
|
9
|
+
lines.push('# Chats');
|
|
10
|
+
|
|
11
|
+
const items = output.items || [];
|
|
12
|
+
const hasMore = !!output.hasMore;
|
|
13
|
+
|
|
14
|
+
if (hasMore) {
|
|
15
|
+
lines.push(`\nFound ${items.length}+ chats (showing ${items.length})`);
|
|
16
|
+
if (output.oldestCursor) {
|
|
17
|
+
lines.push(`Next page (older): cursor='${output.oldestCursor}', direction='before'`);
|
|
18
|
+
}
|
|
19
|
+
if (output.newestCursor) {
|
|
20
|
+
lines.push(`Previous page (newer): cursor='${output.newestCursor}', direction='after'`);
|
|
21
|
+
}
|
|
22
|
+
} else if (items.length > 0) {
|
|
23
|
+
lines.push(`\nFound ${items.length} chat${items.length === 1 ? '' : 's'}`);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (items.length === 0) {
|
|
27
|
+
lines.push('\nNo chats found.');
|
|
28
|
+
} else {
|
|
29
|
+
for (const chat of items) {
|
|
30
|
+
lines.push(formatChatToMarkdown(chat, undefined));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
lines.push('\n# Using this information\n');
|
|
34
|
+
lines.push(
|
|
35
|
+
'- Pass the "chatID" to get_chat or search_messages for details about a chat, or send_message to send a message to a chat.',
|
|
36
|
+
);
|
|
37
|
+
lines.push('- Link the "open" link to the user to allow them to view the chat in Beeper Desktop.');
|
|
38
|
+
return asMarkdownContentResult(lines);
|
|
39
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { HandlerFunction } from '../tools/types';
|
|
2
|
+
import { mapMessagesToText, asMarkdownContentResult } from './utils';
|
|
3
|
+
|
|
4
|
+
export const handler: HandlerFunction = async (client, args) => {
|
|
5
|
+
const body = args as any;
|
|
6
|
+
const output = await client.messages.search(body);
|
|
7
|
+
return asMarkdownContentResult(mapMessagesToText(output, body, undefined));
|
|
8
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { HandlerFunction } from '../tools/types';
|
|
2
|
+
import { asMarkdownContentResult, formatChatToMarkdown, mapMessagesToText } from './utils';
|
|
3
|
+
|
|
4
|
+
export const handler: HandlerFunction = async (client, args) => {
|
|
5
|
+
const body = args as any;
|
|
6
|
+
const output = await client.search(body);
|
|
7
|
+
|
|
8
|
+
const lines: string[] = [];
|
|
9
|
+
if (body?.query) lines.push(`Query: "${body.query}"`);
|
|
10
|
+
const results = output?.results;
|
|
11
|
+
if (results?.chats?.length) {
|
|
12
|
+
lines.push('\n# Chats');
|
|
13
|
+
for (const chat of results.chats) lines.push(formatChatToMarkdown(chat, undefined));
|
|
14
|
+
}
|
|
15
|
+
if (results?.in_groups?.length) {
|
|
16
|
+
lines.push('\n# In Groups');
|
|
17
|
+
for (const chat of results.in_groups) lines.push(formatChatToMarkdown(chat, undefined));
|
|
18
|
+
}
|
|
19
|
+
if (results?.messages?.items?.length) {
|
|
20
|
+
lines.push('\n# Messages');
|
|
21
|
+
lines.push(mapMessagesToText(results.messages as any, body, undefined));
|
|
22
|
+
}
|
|
23
|
+
return asMarkdownContentResult(lines);
|
|
24
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { HandlerFunction } from '../tools/types';
|
|
2
|
+
import { asMarkdownContentResult, createOpenLink } from './utils';
|
|
3
|
+
|
|
4
|
+
export const handler: HandlerFunction = async (client, args) => {
|
|
5
|
+
const body = args as any;
|
|
6
|
+
const output = await client.messages.send(body);
|
|
7
|
+
|
|
8
|
+
const lines: string[] = [];
|
|
9
|
+
if (output.pendingMessageID) {
|
|
10
|
+
const deeplink = createOpenLink('', body?.chatID ?? '');
|
|
11
|
+
if (deeplink) lines.push(`**Open the chat in Beeper**: ${deeplink}`);
|
|
12
|
+
} else {
|
|
13
|
+
lines.push('Failed to send message.');
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return asMarkdownContentResult(lines);
|
|
17
|
+
};
|