botmux 2.2.7 → 2.3.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/README.en.md +63 -13
- package/README.md +52 -14
- package/dist/adapters/cli/aiden.d.ts.map +1 -1
- package/dist/adapters/cli/aiden.js +0 -40
- package/dist/adapters/cli/aiden.js.map +1 -1
- package/dist/adapters/cli/claude-code.d.ts.map +1 -1
- package/dist/adapters/cli/claude-code.js +21 -67
- package/dist/adapters/cli/claude-code.js.map +1 -1
- package/dist/adapters/cli/coco.d.ts.map +1 -1
- package/dist/adapters/cli/coco.js +0 -33
- package/dist/adapters/cli/coco.js.map +1 -1
- package/dist/adapters/cli/codex.d.ts.map +1 -1
- package/dist/adapters/cli/codex.js +0 -27
- package/dist/adapters/cli/codex.js.map +1 -1
- package/dist/adapters/cli/gemini.d.ts.map +1 -1
- package/dist/adapters/cli/gemini.js +1 -29
- package/dist/adapters/cli/gemini.js.map +1 -1
- package/dist/adapters/cli/opencode.d.ts.map +1 -1
- package/dist/adapters/cli/opencode.js +1 -44
- package/dist/adapters/cli/opencode.js.map +1 -1
- package/dist/adapters/cli/types.d.ts +11 -8
- package/dist/adapters/cli/types.d.ts.map +1 -1
- package/dist/cli.js +737 -16
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +16 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +30 -0
- package/dist/config.js.map +1 -1
- package/dist/core/command-handler.d.ts.map +1 -1
- package/dist/core/command-handler.js +8 -4
- package/dist/core/command-handler.js.map +1 -1
- package/dist/core/scheduler.d.ts +38 -16
- package/dist/core/scheduler.d.ts.map +1 -1
- package/dist/core/scheduler.js +335 -149
- package/dist/core/scheduler.js.map +1 -1
- package/dist/core/session-manager.d.ts +6 -0
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +105 -16
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/types.d.ts +26 -4
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js +6 -0
- package/dist/core/types.js.map +1 -1
- package/dist/core/worker-pool.d.ts +15 -3
- package/dist/core/worker-pool.d.ts.map +1 -1
- package/dist/core/worker-pool.js +233 -31
- package/dist/core/worker-pool.js.map +1 -1
- package/dist/daemon.d.ts.map +1 -1
- package/dist/daemon.js +49 -10
- package/dist/daemon.js.map +1 -1
- package/dist/im/lark/card-builder.d.ts +29 -1
- package/dist/im/lark/card-builder.d.ts.map +1 -1
- package/dist/im/lark/card-builder.js +240 -55
- package/dist/im/lark/card-builder.js.map +1 -1
- package/dist/im/lark/card-handler.d.ts +1 -0
- package/dist/im/lark/card-handler.d.ts.map +1 -1
- package/dist/im/lark/card-handler.js +200 -40
- package/dist/im/lark/card-handler.js.map +1 -1
- package/dist/services/schedule-store.d.ts +20 -3
- package/dist/services/schedule-store.d.ts.map +1 -1
- package/dist/services/schedule-store.js +140 -16
- package/dist/services/schedule-store.js.map +1 -1
- package/dist/skills/definitions.d.ts +17 -0
- package/dist/skills/definitions.d.ts.map +1 -0
- package/dist/skills/definitions.js +254 -0
- package/dist/skills/definitions.js.map +1 -0
- package/dist/skills/installer.d.ts +9 -0
- package/dist/skills/installer.d.ts.map +1 -0
- package/dist/skills/installer.js +42 -0
- package/dist/skills/installer.js.map +1 -0
- package/dist/types.d.ts +80 -7
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -5
- package/dist/types.js.map +1 -1
- package/dist/utils/lark-upload.d.ts +2 -0
- package/dist/utils/lark-upload.d.ts.map +1 -0
- package/dist/utils/lark-upload.js +27 -0
- package/dist/utils/lark-upload.js.map +1 -0
- package/dist/utils/screen-analyzer.d.ts +67 -0
- package/dist/utils/screen-analyzer.d.ts.map +1 -0
- package/dist/utils/screen-analyzer.js +256 -0
- package/dist/utils/screen-analyzer.js.map +1 -0
- package/dist/utils/screenshot-renderer.d.ts +11 -0
- package/dist/utils/screenshot-renderer.d.ts.map +1 -0
- package/dist/utils/screenshot-renderer.js +225 -0
- package/dist/utils/screenshot-renderer.js.map +1 -0
- package/dist/utils/terminal-renderer.d.ts +33 -0
- package/dist/utils/terminal-renderer.d.ts.map +1 -1
- package/dist/utils/terminal-renderer.js +33 -0
- package/dist/utils/terminal-renderer.js.map +1 -1
- package/dist/worker.js +283 -14
- package/dist/worker.js.map +1 -1
- package/package.json +2 -5
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -16
- package/dist/index.js.map +0 -1
- package/dist/server.d.ts +0 -3
- package/dist/server.d.ts.map +0 -1
- package/dist/server.js +0 -133
- package/dist/server.js.map +0 -1
- package/dist/tools/get-thread-messages.d.ts +0 -26
- package/dist/tools/get-thread-messages.d.ts.map +0 -1
- package/dist/tools/get-thread-messages.js +0 -38
- package/dist/tools/get-thread-messages.js.map +0 -1
- package/dist/tools/index.d.ts +0 -9
- package/dist/tools/index.d.ts.map +0 -1
- package/dist/tools/index.js +0 -10
- package/dist/tools/index.js.map +0 -1
- package/dist/tools/list-bots.d.ts +0 -40
- package/dist/tools/list-bots.d.ts.map +0 -1
- package/dist/tools/list-bots.js +0 -77
- package/dist/tools/list-bots.js.map +0 -1
- package/dist/tools/send-to-thread.d.ts +0 -46
- package/dist/tools/send-to-thread.d.ts.map +0 -1
- package/dist/tools/send-to-thread.js +0 -275
- package/dist/tools/send-to-thread.js.map +0 -1
package/dist/server.js
DELETED
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
import { ListToolsRequestSchema } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
-
import { execSync } from 'node:child_process';
|
|
4
|
-
import { existsSync, readFileSync } from 'node:fs';
|
|
5
|
-
import { join } from 'node:path';
|
|
6
|
-
import { registerBot, loadBotConfigs } from './bot-registry.js';
|
|
7
|
-
import * as sessionStore from './services/session-store.js';
|
|
8
|
-
import { tools } from './tools/index.js';
|
|
9
|
-
import { logger } from './utils/logger.js';
|
|
10
|
-
/**
|
|
11
|
-
* Walk up the process tree and look for a CLI PID marker written by the
|
|
12
|
-
* botmux worker. Returns the session ID stored in the marker, or null.
|
|
13
|
-
*
|
|
14
|
-
* The marker file now contains the session ID (was empty in older versions).
|
|
15
|
-
* Backward-compatible: returns `''` for empty markers (still counts as found).
|
|
16
|
-
*
|
|
17
|
-
* Cross-platform: uses `ps -o ppid=` (works on macOS + Linux).
|
|
18
|
-
*/
|
|
19
|
-
function findAncestorCliMarker() {
|
|
20
|
-
const dataDir = process.env.SESSION_DATA_DIR;
|
|
21
|
-
if (!dataDir)
|
|
22
|
-
return { found: false };
|
|
23
|
-
const markersDir = join(dataDir, '.botmux-cli-pids');
|
|
24
|
-
let pid = process.ppid;
|
|
25
|
-
for (let depth = 0; depth < 8 && pid > 1; depth++) {
|
|
26
|
-
const markerPath = join(markersDir, String(pid));
|
|
27
|
-
if (existsSync(markerPath)) {
|
|
28
|
-
try {
|
|
29
|
-
const content = readFileSync(markerPath, 'utf-8').trim();
|
|
30
|
-
return { found: true, sessionId: content || undefined };
|
|
31
|
-
}
|
|
32
|
-
catch {
|
|
33
|
-
return { found: true };
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
try {
|
|
37
|
-
const output = execSync(`ps -o ppid= -p ${pid}`, {
|
|
38
|
-
encoding: 'utf-8',
|
|
39
|
-
timeout: 2000,
|
|
40
|
-
stdio: ['ignore', 'pipe', 'ignore'],
|
|
41
|
-
}).trim();
|
|
42
|
-
pid = parseInt(output, 10);
|
|
43
|
-
if (isNaN(pid))
|
|
44
|
-
break;
|
|
45
|
-
}
|
|
46
|
-
catch {
|
|
47
|
-
break;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
return { found: false };
|
|
51
|
-
}
|
|
52
|
-
export function createServer() {
|
|
53
|
-
// Register all bots so MCP tools can send messages as any bot.
|
|
54
|
-
// loadBotConfigs() reads from bots.json / env vars — works regardless
|
|
55
|
-
// of whether the CLI passes LARK_APP_ID through to the MCP subprocess.
|
|
56
|
-
try {
|
|
57
|
-
const configs = loadBotConfigs();
|
|
58
|
-
for (const cfg of configs) {
|
|
59
|
-
registerBot(cfg);
|
|
60
|
-
}
|
|
61
|
-
logger.info(`MCP server registered ${configs.length} bot(s)`);
|
|
62
|
-
}
|
|
63
|
-
catch (err) {
|
|
64
|
-
logger.warn(`MCP server: no bot configs found (${err.message}). Tools will fail at runtime.`);
|
|
65
|
-
}
|
|
66
|
-
// Scope session store to the owning bot's per-bot file (sessions-{appId}.json).
|
|
67
|
-
// LARK_APP_ID is inherited from the worker process env.
|
|
68
|
-
const appId = process.env.LARK_APP_ID;
|
|
69
|
-
if (appId) {
|
|
70
|
-
sessionStore.init(appId);
|
|
71
|
-
}
|
|
72
|
-
// Two-gate session detection:
|
|
73
|
-
//
|
|
74
|
-
// 1. BOTMUX=1 in env — set in the static MCP config so it reaches all
|
|
75
|
-
// CLI MCP servers (the MCP SDK only passes config env + a 6-var
|
|
76
|
-
// whitelist to the server subprocess, NOT the full parent env).
|
|
77
|
-
//
|
|
78
|
-
// 2. findAncestorCliMarker() — walks the process tree (via `ps -o ppid=`)
|
|
79
|
-
// and reads the marker file written by the botmux worker (contains the
|
|
80
|
-
// session ID). Handles CLIs that fork internal subprocesses.
|
|
81
|
-
// Cross-platform: `ps -o ppid=` works on both macOS and Linux.
|
|
82
|
-
const marker = findAncestorCliMarker();
|
|
83
|
-
const isBotmuxSession = process.env.BOTMUX === '1' && marker.found;
|
|
84
|
-
const autoSessionId = marker.sessionId;
|
|
85
|
-
if (autoSessionId) {
|
|
86
|
-
logger.info(`MCP server: auto-detected session ID ${autoSessionId.substring(0, 8)}...`);
|
|
87
|
-
}
|
|
88
|
-
const instructions = isBotmuxSession
|
|
89
|
-
? [
|
|
90
|
-
'You are connected to a Lark (Feishu) topic group. The user reads Lark, not your terminal.',
|
|
91
|
-
'Anything you want the user to see MUST go through the send_to_thread tool — your terminal output never reaches the chat.',
|
|
92
|
-
'',
|
|
93
|
-
'Guidelines:',
|
|
94
|
-
'- Use send_to_thread for: key conclusions, proposed plans (wait for confirmation before executing), final results, and progress updates.',
|
|
95
|
-
'- Send plain text — formatting is handled automatically. You can also attach images and files.',
|
|
96
|
-
'- To send images: pass local file paths in the `images` array (e.g. screenshots, charts, diagrams). Images are embedded inline in the message.',
|
|
97
|
-
'- To send files: pass local file paths in the `files` array (e.g. PDFs, documents). Each file is sent as a separate message.',
|
|
98
|
-
'- Use get_thread_messages to read earlier conversation context if needed.',
|
|
99
|
-
].join('\n')
|
|
100
|
-
: undefined;
|
|
101
|
-
const server = new McpServer({
|
|
102
|
-
name: 'botmux',
|
|
103
|
-
version: '1.0.0',
|
|
104
|
-
}, {
|
|
105
|
-
...(instructions && { instructions }),
|
|
106
|
-
});
|
|
107
|
-
// Only register tools inside botmux sessions. Outside botmux, tools would
|
|
108
|
-
// fail anyway and just waste tool-description context tokens.
|
|
109
|
-
if (isBotmuxSession) {
|
|
110
|
-
for (const [name, tool] of Object.entries(tools)) {
|
|
111
|
-
server.tool(name, tool.description, tool.schema.shape, async (args) => {
|
|
112
|
-
// Auto-fill session_id from PID marker when the LLM omits it
|
|
113
|
-
if (autoSessionId && !args.session_id) {
|
|
114
|
-
args.session_id = autoSessionId;
|
|
115
|
-
}
|
|
116
|
-
logger.info(`Tool called: ${name}`, args);
|
|
117
|
-
const result = await tool.execute(args);
|
|
118
|
-
return {
|
|
119
|
-
content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
|
|
120
|
-
};
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
125
|
-
// Declare empty tools capability so CLI clients (e.g. Codex) that call
|
|
126
|
-
// tools/list during startup don't fail with "Method not found" (-32601).
|
|
127
|
-
server.server.registerCapabilities({ tools: {} });
|
|
128
|
-
server.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [] }));
|
|
129
|
-
logger.info('MCP server: not a botmux session — running as empty shell (no tools, no instructions)');
|
|
130
|
-
}
|
|
131
|
-
return server;
|
|
132
|
-
}
|
|
133
|
-
//# sourceMappingURL=server.js.map
|
package/dist/server.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,cAAc,EAAc,MAAM,mBAAmB,CAAC;AAC5E,OAAO,KAAK,YAAY,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C;;;;;;;;GAQG;AACH,SAAS,qBAAqB;IAC5B,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;IAC7C,IAAI,CAAC,OAAO;QAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;IACtC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;IACrD,IAAI,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IACvB,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC;QAClD,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;QACjD,IAAI,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YAC3B,IAAI,CAAC;gBACH,MAAM,O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AAM,CAAC,KAAK,EAAE,KAAK,EAAE,IAAS,EAAE,EAAE;gBACzE,6DAA6D;gBAC7D,IAAI,aAAa,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;oBACtC,IAAI,CAAC,UAAU,GAAG,aAAa,CAAC;gBAClC,CAAC;gBACD,MAAM,CAAC,IAAI,CAAC,gBAAgB,IAAI,EAAE,EAAE,IAAI,CAAC,CAAC;gBAC1C,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;gBACxC,OAAO;oBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;iBAC5E,CAAC;YACJ,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;SAAM,CAAC;QACN,uEAAuE;QACvE,yEAAyE;QACzE,MAAM,CAAC,MAAM,CAAC,oBAAoB,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;QAClD,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;QACrF,MAAM,CAAC,IAAI,CAAC,uFAAuF,CAAC,CAAC;IACvG,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const schema: z.ZodObject<{
|
|
3
|
-
session_id: z.ZodOptional<z.ZodString>;
|
|
4
|
-
limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
5
|
-
}, "strip", z.ZodTypeAny, {
|
|
6
|
-
limit: number;
|
|
7
|
-
session_id?: string | undefined;
|
|
8
|
-
}, {
|
|
9
|
-
session_id?: string | undefined;
|
|
10
|
-
limit?: number | undefined;
|
|
11
|
-
}>;
|
|
12
|
-
export declare const description = "Get message history from the Lark thread associated with a session.";
|
|
13
|
-
export declare function execute(args: z.infer<typeof schema>): Promise<{
|
|
14
|
-
error: string;
|
|
15
|
-
sessionId?: undefined;
|
|
16
|
-
threadId?: undefined;
|
|
17
|
-
messages?: undefined;
|
|
18
|
-
total?: undefined;
|
|
19
|
-
} | {
|
|
20
|
-
sessionId: string;
|
|
21
|
-
threadId: string;
|
|
22
|
-
messages: import("../types.js").LarkMessage[];
|
|
23
|
-
total: number;
|
|
24
|
-
error?: undefined;
|
|
25
|
-
}>;
|
|
26
|
-
//# sourceMappingURL=get-thread-messages.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-thread-messages.d.ts","sourceRoot":"","sources":["../../src/tools/get-thread-messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,MAAM;;;;;;;;;EAGjB,CAAC;AAEH,eAAO,MAAM,WAAW,wEAAwE,CAAC;AAEjG,wBAAsB,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC;;;;;;;;;;;;GA0BzD"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import * as sessionStore from '../services/session-store.js';
|
|
3
|
-
import { listThreadMessages } from '../im/lark/client.js';
|
|
4
|
-
import { parseApiMessage } from '../im/lark/message-parser.js';
|
|
5
|
-
import { config } from '../config.js';
|
|
6
|
-
import { logger } from '../utils/logger.js';
|
|
7
|
-
export const schema = z.object({
|
|
8
|
-
session_id: z.string().optional().describe('Session ID for the active session (auto-detected if omitted)'),
|
|
9
|
-
limit: z.number().optional().default(50).describe('Max number of messages to return (default 50)'),
|
|
10
|
-
});
|
|
11
|
-
export const description = 'Get message history from the Lark thread associated with a session.';
|
|
12
|
-
export async function execute(args) {
|
|
13
|
-
if (!args.session_id) {
|
|
14
|
-
return { error: 'session_id is required but was not provided and could not be auto-detected' };
|
|
15
|
-
}
|
|
16
|
-
const session = sessionStore.getSession(args.session_id);
|
|
17
|
-
if (!session) {
|
|
18
|
-
return { error: `Session ${args.session_id} not found` };
|
|
19
|
-
}
|
|
20
|
-
try {
|
|
21
|
-
// List chat messages and filter by root_id to get thread messages
|
|
22
|
-
const appId = session.larkAppId || config.lark.appId;
|
|
23
|
-
const rawMessages = await listThreadMessages(appId, session.chatId, session.rootMessageId, args.limit);
|
|
24
|
-
const messages = rawMessages.map(parseApiMessage);
|
|
25
|
-
logger.info(`Retrieved ${messages.length} messages for session ${args.session_id}`);
|
|
26
|
-
return {
|
|
27
|
-
sessionId: args.session_id,
|
|
28
|
-
threadId: session.rootMessageId,
|
|
29
|
-
messages,
|
|
30
|
-
total: messages.length,
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
catch (err) {
|
|
34
|
-
logger.error(`Failed to get thread messages: ${err.message}`);
|
|
35
|
-
return { error: `Failed to get messages: ${err.message}` };
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=get-thread-messages.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-thread-messages.js","sourceRoot":"","sources":["../../src/tools/get-thread-messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,YAAY,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE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,KAAK,CAAC,kCAAkC,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;QAC9D,OAAO,EAAE,KAAK,EAAE,2BAA2B,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC;IAC7D,CAAC;AACH,CAAC"}
|
package/dist/tools/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as sendToThread from './send-to-thread.js';
|
|
2
|
-
import * as getThreadMessages from './get-thread-messages.js';
|
|
3
|
-
import * as listBots from './list-bots.js';
|
|
4
|
-
export declare const tools: {
|
|
5
|
-
readonly send_to_thread: typeof sendToThread;
|
|
6
|
-
readonly get_thread_messages: typeof getThreadMessages;
|
|
7
|
-
readonly list_bots: typeof listBots;
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,YAAY,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,iBAAiB,MAAM,0BAA0B,CAAC;AAE9D,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,eAAO,MAAM,KAAK;;;;CAKR,CAAC"}
|
package/dist/tools/index.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { TOOL_NAMES } from '../types.js';
|
|
2
|
-
import * as sendToThread from './send-to-thread.js';
|
|
3
|
-
import * as getThreadMessages from './get-thread-messages.js';
|
|
4
|
-
import * as listBots from './list-bots.js';
|
|
5
|
-
export const tools = {
|
|
6
|
-
[TOOL_NAMES.SEND_TO_THREAD]: sendToThread,
|
|
7
|
-
[TOOL_NAMES.GET_THREAD_MESSAGES]: getThreadMessages,
|
|
8
|
-
[TOOL_NAMES.LIST_BOTS]: listBots,
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=index.js.map
|
package/dist/tools/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,YAAY,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,iBAAiB,MAAM,0BAA0B,CAAC;AAE9D,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,YAAY;IACzC,CAAC,UAAU,CAAC,mBAAmB,CAAC,EAAE,iBAAiB;IAEnD,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,QAAQ;CACxB,CAAC"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const schema: z.ZodObject<{
|
|
3
|
-
session_id: z.ZodOptional<z.ZodString>;
|
|
4
|
-
}, "strip", z.ZodTypeAny, {
|
|
5
|
-
session_id?: string | undefined;
|
|
6
|
-
}, {
|
|
7
|
-
session_id?: string | undefined;
|
|
8
|
-
}>;
|
|
9
|
-
export declare const description = "List bots available in the current group chat. Returns bot names, open_ids, and CLI types for use with send_to_thread mentions.";
|
|
10
|
-
export declare function execute(args: z.infer<typeof schema>): Promise<{
|
|
11
|
-
error: string;
|
|
12
|
-
sessionId?: undefined;
|
|
13
|
-
chatId?: undefined;
|
|
14
|
-
bots?: undefined;
|
|
15
|
-
total?: undefined;
|
|
16
|
-
hint?: undefined;
|
|
17
|
-
} | {
|
|
18
|
-
sessionId: string;
|
|
19
|
-
chatId: string;
|
|
20
|
-
bots: {
|
|
21
|
-
name: string;
|
|
22
|
-
openId: string;
|
|
23
|
-
isSelf: boolean;
|
|
24
|
-
}[];
|
|
25
|
-
total: number;
|
|
26
|
-
hint: string;
|
|
27
|
-
error?: undefined;
|
|
28
|
-
} | {
|
|
29
|
-
sessionId: string;
|
|
30
|
-
bots: {
|
|
31
|
-
name: string;
|
|
32
|
-
openId: string;
|
|
33
|
-
isSelf: boolean;
|
|
34
|
-
}[];
|
|
35
|
-
total: number;
|
|
36
|
-
hint: string;
|
|
37
|
-
error?: undefined;
|
|
38
|
-
chatId?: undefined;
|
|
39
|
-
}>;
|
|
40
|
-
//# sourceMappingURL=list-bots.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list-bots.d.ts","sourceRoot":"","sources":["../../src/tools/list-bots.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,MAAM;;;;;;EAEjB,CAAC;AAEH,eAAO,MAAM,WAAW,oIAAoI,CAAC;AAoB7J,wBAAsB,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DzD"}
|
package/dist/tools/list-bots.js
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { readFileSync, existsSync } from 'node:fs';
|
|
3
|
-
import { join } from 'node:path';
|
|
4
|
-
import * as sessionStore from '../services/session-store.js';
|
|
5
|
-
import { listChatBotMembers } from '../im/lark/client.js';
|
|
6
|
-
import { config } from '../config.js';
|
|
7
|
-
import { logger } from '../utils/logger.js';
|
|
8
|
-
export const schema = z.object({
|
|
9
|
-
session_id: z.string().optional().describe('Session ID — used to determine which group chat to query for bot members (auto-detected if omitted)'),
|
|
10
|
-
});
|
|
11
|
-
export const description = 'List bots available in the current group chat. Returns bot names, open_ids, and CLI types for use with send_to_thread mentions.';
|
|
12
|
-
/** Read bots-info.json written by the daemon. */
|
|
13
|
-
function readBotInfo() {
|
|
14
|
-
const filePath = join(config.session.dataDir, 'bots-info.json');
|
|
15
|
-
if (!existsSync(filePath))
|
|
16
|
-
return [];
|
|
17
|
-
try {
|
|
18
|
-
return JSON.parse(readFileSync(filePath, 'utf-8'));
|
|
19
|
-
}
|
|
20
|
-
catch {
|
|
21
|
-
return [];
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
export async function execute(args) {
|
|
25
|
-
if (!args.session_id) {
|
|
26
|
-
return { error: 'session_id is required but was not provided and could not be auto-detected' };
|
|
27
|
-
}
|
|
28
|
-
const session = sessionStore.getSession(args.session_id);
|
|
29
|
-
if (!session) {
|
|
30
|
-
return { error: `Session ${args.session_id} not found` };
|
|
31
|
-
}
|
|
32
|
-
const appId = session.larkAppId || config.lark.appId;
|
|
33
|
-
const botInfo = readBotInfo();
|
|
34
|
-
// Build a map of cliId → bot info for lookup (open_id matching is unreliable
|
|
35
|
-
// because Lark open_ids are per-app scoped)
|
|
36
|
-
const botByCli = new Map();
|
|
37
|
-
for (const b of botInfo) {
|
|
38
|
-
botByCli.set(b.cliId, b);
|
|
39
|
-
}
|
|
40
|
-
try {
|
|
41
|
-
// Query group chat members to find bots in this chat
|
|
42
|
-
const chatBots = await listChatBotMembers(appId, session.chatId);
|
|
43
|
-
const result = chatBots.map(cb => {
|
|
44
|
-
const info = botByCli.get(cb.name); // cb.name is cliId
|
|
45
|
-
return {
|
|
46
|
-
name: cb.displayName,
|
|
47
|
-
openId: cb.openId,
|
|
48
|
-
isSelf: info?.larkAppId === appId,
|
|
49
|
-
};
|
|
50
|
-
});
|
|
51
|
-
return {
|
|
52
|
-
sessionId: args.session_id,
|
|
53
|
-
chatId: session.chatId,
|
|
54
|
-
bots: result,
|
|
55
|
-
total: result.length,
|
|
56
|
-
hint: 'Use send_to_thread with mentions parameter to @mention a bot. Pass open_id and name from this list.',
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
catch (err) {
|
|
60
|
-
logger.warn(`listChatBotMembers failed, falling back to bots-info.json: ${err.message}`);
|
|
61
|
-
// Fallback: return all known bots from the registry file
|
|
62
|
-
const result = botInfo
|
|
63
|
-
.filter(b => b.botOpenId)
|
|
64
|
-
.map(b => ({
|
|
65
|
-
name: b.botName ?? b.cliId,
|
|
66
|
-
openId: b.botOpenId,
|
|
67
|
-
isSelf: b.larkAppId === appId,
|
|
68
|
-
}));
|
|
69
|
-
return {
|
|
70
|
-
sessionId: args.session_id,
|
|
71
|
-
bots: result,
|
|
72
|
-
total: result.length,
|
|
73
|
-
hint: 'Use send_to_thread with mentions parameter to @mention a bot. Note: chat member query failed, showing all registered bots.',
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
//# sourceMappingURL=list-bots.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list-bots.js","sourceRoot":"","sources":["../../src/tools/list-bots.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,KAAK,YAAY,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,qGAAqG,CAAC;CAClJ,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG,iIAAiI,CAAC;AAS7J,iDAAiD;AACjD,SAAS,WAAW;IAClB,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;IAChE,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,OAAO,EAAE,CAAC;IACrC,IAAI,CAAC;QACH,O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,EAAE,IAAI,EAAE,SAAS,KAAK,KAAK;aAClC,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,OAAO;YACL,SAAS,EAAE,IAAI,CAAC,UAAU;YAC1B,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,MAAM,CAAC,MAAM;YACpB,IAAI,EAAE,qGAAqG;SAC5G,CAAC;IACJ,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,MAAM,CAAC,IAAI,CAAC,8DAA8D,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;QAEzF,yDAAyD;QACzD,MAAM,MAAM,GAAG,OAAO;aACnB,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;aACxB,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;YACT,IAAI,EAAE,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,KAAK;YAC1B,MAAM,EAAE,CAAC,CAAC,SAAU;YACpB,MAAM,EAAE,CAAC,CAAC,SAAS,KAAK,KAAK;SAC9B,CAAC,CAAC,CAAC;QAEN,OAAO;YACL,SAAS,EAAE,IAAI,CAAC,UAAU;YAC1B,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,MAAM,CAAC,MAAM;YACpB,IAAI,EAAE,4HAA4H;SACnI,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const schema: z.ZodObject<{
|
|
3
|
-
session_id: z.ZodOptional<z.ZodString>;
|
|
4
|
-
content: z.ZodString;
|
|
5
|
-
images: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
6
|
-
files: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
7
|
-
mentions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
8
|
-
open_id: z.ZodString;
|
|
9
|
-
name: z.ZodString;
|
|
10
|
-
}, "strip", z.ZodTypeAny, {
|
|
11
|
-
open_id: string;
|
|
12
|
-
name: string;
|
|
13
|
-
}, {
|
|
14
|
-
open_id: string;
|
|
15
|
-
name: string;
|
|
16
|
-
}>, "many">>;
|
|
17
|
-
}, "strip", z.ZodTypeAny, {
|
|
18
|
-
content: string;
|
|
19
|
-
mentions?: {
|
|
20
|
-
open_id: string;
|
|
21
|
-
name: string;
|
|
22
|
-
}[] | undefined;
|
|
23
|
-
session_id?: string | undefined;
|
|
24
|
-
images?: string[] | undefined;
|
|
25
|
-
files?: string[] | undefined;
|
|
26
|
-
}, {
|
|
27
|
-
content: string;
|
|
28
|
-
mentions?: {
|
|
29
|
-
open_id: string;
|
|
30
|
-
name: string;
|
|
31
|
-
}[] | undefined;
|
|
32
|
-
session_id?: string | undefined;
|
|
33
|
-
images?: string[] | undefined;
|
|
34
|
-
files?: string[] | undefined;
|
|
35
|
-
}>;
|
|
36
|
-
export declare const description = "Send a message to the Lark thread associated with a session. Supports plain text, images (embedded inline), and file attachments. Just send plain text \u2014 formatting is handled automatically. Use `images` to attach local image files (png/jpg/gif etc.) and `files` to attach documents.";
|
|
37
|
-
export declare function execute(args: z.infer<typeof schema>): Promise<{
|
|
38
|
-
error: string;
|
|
39
|
-
} | {
|
|
40
|
-
sessionId: string;
|
|
41
|
-
fileMessageIds?: string[] | undefined;
|
|
42
|
-
success: boolean;
|
|
43
|
-
messageId: string;
|
|
44
|
-
error?: undefined;
|
|
45
|
-
}>;
|
|
46
|
-
//# sourceMappingURL=send-to-thread.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"send-to-thread.d.ts","sourceRoot":"","sources":["../../src/tools/send-to-thread.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASjB,CAAC;AAEH,eAAO,MAAM,WAAW,oSAA+R,CAAC;AAuExT,wBAAsB,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC;;;;;;;;GAoMzD"}
|