将 `tools.ts` 拆分为按功能划分的独立文件,并存放于 `tools/` 目录下,同时更新导入路径;优化 agent 系统提示语,移除冗余的「美图 Agent」前缀。
23 lines
743 B
TypeScript
23 lines
743 B
TypeScript
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;
|
|
},
|
|
};
|