refactor(agent): 将 tools 模块拆分为独立文件并优化导入路径

将 `tools.ts` 拆分为按功能划分的独立文件,并存放于 `tools/` 目录下,同时更新导入路径;优化 agent 系统提示语,移除冗余的「美图 Agent」前缀。
This commit is contained in:
2026-05-08 01:05:37 +08:00
parent 10f11189f8
commit 2ab5396461
16 changed files with 493 additions and 440 deletions

View File

@@ -0,0 +1,23 @@
import path from 'path';
import fs from 'fs';
import { ACCOUNTS_DIR, loadJSON } from './shared';
import type { ToolDefinition } from './types';
export const getAccountConfig: ToolDefinition = {
name: 'get_account_config',
description: '获取指定账号的完整配置包括模型选择、TTS语音、字幕风格等',
input_schema: {
type: 'object',
properties: {
accountId: { type: 'string', description: '账号ID如 军事账号' },
},
required: ['accountId'],
},
execute: async (params) => {
const { accountId } = params as { accountId: string };
const configPath = path.join(ACCOUNTS_DIR, accountId, 'account.json');
if (!fs.existsSync(configPath)) return `账号「${accountId}」不存在`;
const cfg = loadJSON(configPath);
return JSON.stringify(cfg, null, 2);
},
};