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; }, };