42 lines
1.3 KiB
TypeScript
42 lines
1.3 KiB
TypeScript
import { z } from "zod";
|
|
import * as api from "./api.js";
|
|
import {
|
|
PlatformClients,
|
|
listAllWorkflows,
|
|
findWorkflowsByTaskType,
|
|
} from "./services.js";
|
|
|
|
// ── 精简核心 MCP Tools (其余功能均由 CLI 和底层 SDK 直接提供) ──────────────────
|
|
|
|
export const platformTools = [
|
|
{
|
|
name: "platform_workflow_list_all",
|
|
description: "跨所有启用自建应用汇总工作流列表,返回带 platformId/platformName 的聚合结果",
|
|
parameters: z.object({
|
|
page: z.number().optional().describe("页码,默认 1"),
|
|
pageSize: z.number().optional().describe("每页数量,默认 20"),
|
|
}),
|
|
handler: async (
|
|
clients: PlatformClients,
|
|
params: { page?: number; pageSize?: number }
|
|
) => {
|
|
return await listAllWorkflows(clients, params);
|
|
},
|
|
},
|
|
{
|
|
name: "platform_workflow_detail",
|
|
description: "获取工作流节点与 DSL 配置详情",
|
|
parameters: z.object({
|
|
pipelineId: z.string().describe("工作流 ID"),
|
|
}),
|
|
handler: async (
|
|
{ easoClient }: PlatformClients,
|
|
params: { pipelineId: string }
|
|
) => {
|
|
return await api.getWorkflowDetail(easoClient, params.pipelineId);
|
|
},
|
|
},
|
|
];
|
|
|
|
export type PlatformTool = (typeof platformTools)[number];
|