refactor(agent): 将 tools 模块拆分为独立文件并优化导入路径
将 `tools.ts` 拆分为按功能划分的独立文件,并存放于 `tools/` 目录下,同时更新导入路径;优化 agent 系统提示语,移除冗余的「美图 Agent」前缀。
This commit is contained in:
22
web/server/agent/tools/pipeline-status.ts
Normal file
22
web/server/agent/tools/pipeline-status.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { execSync } from 'child_process';
|
||||
import { PIPELINE_SCRIPT, PROJECT_ROOT } from './shared';
|
||||
import type { ToolDefinition } from './types';
|
||||
|
||||
export const pipelineStatus: ToolDefinition = {
|
||||
name: 'pipeline_status',
|
||||
description: '查看指定 manifest 的 pipeline 执行进度和各阶段状态',
|
||||
input_schema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
manifest: { type: 'string', description: 'manifest.json 的绝对路径' },
|
||||
},
|
||||
required: ['manifest'],
|
||||
},
|
||||
execute: async (params) => {
|
||||
const { manifest } = params as { manifest: string };
|
||||
const result = execSync(`node "${PIPELINE_SCRIPT}" status --manifest "${manifest}"`, {
|
||||
cwd: PROJECT_ROOT, encoding: 'utf-8',
|
||||
});
|
||||
return result;
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user