diff --git a/dist/mcp/server.js b/dist/mcp/server.js index 9c8febd..296a681 100644 --- a/dist/mcp/server.js +++ b/dist/mcp/server.js @@ -25492,7 +25492,7 @@ var SimulationBatchParamsSchema = exports_external.object({ skipInvoiceGeneration: exports_external.boolean().optional(), skipExpenseExtraction: exports_external.boolean().optional(), disableAttachmentCache: exports_external.boolean().optional(), - thinkingDepthOverride: exports_external.enum(["medium", "high"]).optional(), + thinkingDepthOverride: exports_external.enum(["default", "medium", "high"]).optional(), startTime: exports_external.number().optional(), endTime: exports_external.number().optional(), templateId: exports_external.string().optional(), @@ -27217,9 +27217,8 @@ var sealTools = [ parameters: exports_external.object({ mode: exports_external.enum(["hosecloud", "material_pack"]).default("hosecloud").describe("来源模式: hosecloud=合思指定单号; material_pack=材料包导入"), flowIds: exports_external.array(exports_external.string()).max(100).optional().describe("合思模式: 单据流水号列表"), - limit: exports_external.number().int().positive().max(100).optional().describe("指定单号数量, 默认取 flowIds 个数"), - rejectNodeName: exports_external.string().nullable().optional().describe("仅关注特定节点: 节点名称, 不传为 null 表示不限制"), - thinkingDepthOverride: exports_external.enum(["medium", "high"]).nullable().optional().describe("思考深度: medium=标准, high=深度推理, 不传=按偏好设置"), + rejectNodeName: exports_external.string().nullable().optional().describe("仅关注特定节点: 节点名称, 不设为 null 表示不限制"), + thinkingDepthOverride: exports_external.enum(["default", "medium", "high"]).optional().describe("思考深度: default=按偏好设置, medium=标准, high=深度推理"), skipInvoiceGeneration: exports_external.boolean().optional().describe("跳过发票生成, 默认 true"), skipExpenseExtraction: exports_external.boolean().optional().describe("跳过费用提取, 默认 true"), disableAttachmentCache: exports_external.boolean().optional().describe("不使用附件缓存, 默认 false"), @@ -27243,9 +27242,8 @@ var sealTools = [ const payload = buildSimulationBatchParams({ mode, flowIds: params.flowIds, - limit: params.limit, rejectNodeName: params.rejectNodeName, - thinkingDepthOverride: params.thinkingDepthOverride ?? undefined, + thinkingDepthOverride: params.thinkingDepthOverride, skipInvoiceGeneration: params.skipInvoiceGeneration, skipExpenseExtraction: params.skipExpenseExtraction, disableAttachmentCache: params.disableAttachmentCache, @@ -27567,32 +27565,37 @@ function pickRuleFields(rule, fields) { } function buildSimulationBatchParams(input) { const params = { - approvalCode: input.mode, - nodeId: input.mode, skipInvoiceGeneration: input.skipInvoiceGeneration ?? true, - skipExpenseExtraction: input.skipExpenseExtraction ?? true + skipExpenseExtraction: input.skipExpenseExtraction ?? true, + thinkingDepthOverride: input.thinkingDepthOverride ?? "default" }; if (input.mode === "hosecloud") { if (!input.flowIds?.length) { throw new Error("hosecloud 模式需要提供 flowIds(单号列表)"); } Object.assign(params, { - flowIds: input.flowIds, - limit: input.limit ?? input.flowIds.length, dataCollectionMode: "2", - disableAttachmentCache: input.disableAttachmentCache ?? false + rejectNodeName: input.rejectNodeName ?? null, + skipInvoiceGeneration: input.skipInvoiceGeneration ?? true, + skipExpenseExtraction: input.skipExpenseExtraction ?? true, + disableAttachmentCache: input.disableAttachmentCache ?? false, + thinkingDepthOverride: input.thinkingDepthOverride ?? "default", + sourceSystem: "hosecloud", + flowIds: input.flowIds }); if (input.signKey) params.signKey = input.signKey; - if (input.rejectNodeName !== undefined) - params.rejectNodeName = input.rejectNodeName; } else { if (!input.packageIds?.length) { throw new Error("material_pack 模式需要提供 packageIds(材料包 id)"); } Object.assign(params, { + sourceSystem: "material_pack", packageIds: input.packageIds, - runMode: "import_and_simulate" + runMode: "import_and_simulate", + skipInvoiceGeneration: input.skipInvoiceGeneration ?? true, + skipExpenseExtraction: input.skipExpenseExtraction ?? true, + thinkingDepthOverride: input.thinkingDepthOverride ?? "default" }); if (input.templateId) params.templateId = input.templateId; @@ -27601,8 +27604,6 @@ function buildSimulationBatchParams(input) { if (input.schemaConfig !== undefined) params.schemaConfig = input.schemaConfig; } - if (input.thinkingDepthOverride) - params.thinkingDepthOverride = input.thinkingDepthOverride; if (input.rawParams) Object.assign(params, input.rawParams); return params; @@ -29245,7 +29246,6 @@ async function dispatch(argv, runtime) { await runTool("seal_simulation_batch_create", client, corp, { mode, flowIds: splitOption(args.options.flowIds) ?? splitOption(args.options["flow-ids"]), - limit: numberOption(args.options.limit), rejectNodeName: stringOption(args.options.rejectNode) ?? stringOption(args.options["reject-node"]) ?? null, thinkingDepthOverride: stringOption(args.options.thinkingDepth) ?? stringOption(args.options["thinking-depth"]), skipInvoiceGeneration: booleanOption(args.options.skipInvoiceGeneration) ?? booleanOption(args.options["skip-invoice-generation"]), @@ -30006,7 +30006,7 @@ Usage: seal-home approval-runs url --sourceDocumentSN B26022501 [--corp ] seal-home approval-runs bridge [--sourceDocumentSN B26001887] [--corp ] seal-home simulation batch-records [--corp ] - seal-home simulation create --mode hosecloud --flow-ids "B26017701,B26022501" [--limit 2] [--reject-node 财务] [--thinking-depth medium|high] [--skip-invoice-generation|--skip-invoice-generation false] [--corp ] + seal-home simulation create --mode hosecloud --flow-ids "B26017701,B26022501" [--reject-node 财务] [--thinking-depth default|medium|high] [--skip-invoice-generation|--skip-invoice-generation false] [--corp ] seal-home simulation create --mode material_pack --package-ids [--package-label 名称] [--template-id conference_reimbursement_v1] [--schema-config file.json] [--corp ] seal-home simulation list [--limit 50] [--corp ] seal-home simulation get [--corp ] diff --git a/skills/seal-home/SKILL.md b/skills/seal-home/SKILL.md index 9abb63e..98d6a51 100644 --- a/skills/seal-home/SKILL.md +++ b/skills/seal-home/SKILL.md @@ -62,7 +62,7 @@ seal-home rules clear --corp --dry-run seal-home rules clear --corp --yes seal-home rules get --corp --version 16 --code '#0038' seal-home rules get --corp --record-id --runtime-id rule-205 -seal-home simulation create --corp --mode hosecloud --flow-ids "B26017701,B26022501" [--limit 2] [--reject-node 财务] [--thinking-depth medium|high] +seal-home simulation create --corp --mode hosecloud --flow-ids "B26017701,B26022501" [--reject-node 财务] [--thinking-depth default|medium|high] seal-home simulation create --corp --mode material_pack --package-ids [--schema-config file.json] seal-home simulation package-upload <材料包.zip> --corp seal-home simulation list --corp diff --git a/skills/seal-home/references/cli.md b/skills/seal-home/references/cli.md index 3df2f62..e77481d 100644 --- a/skills/seal-home/references/cli.md +++ b/skills/seal-home/references/cli.md @@ -72,7 +72,7 @@ seal-home approval-runs url --corp seal-home approval-runs url --sourceDocumentSN --corp seal-home approval-runs bridge --corp [--sourceDocumentSN ] seal-home simulation batch-records --corp -seal-home simulation create --mode hosecloud --flow-ids "B26017701,B26022501" [--limit 2] [--reject-node 财务] [--thinking-depth medium|high] [--skip-invoice-generation|--skip-invoice-generation false] --corp +seal-home simulation create --mode hosecloud --flow-ids "B26017701,B26022501" [--reject-node 财务] [--thinking-depth default|medium|high] [--skip-invoice-generation|--skip-invoice-generation false] --corp seal-home simulation create --mode material_pack --package-ids [--package-label 名称] [--template-id conference_reimbursement_v1] [--schema-config file.json] --corp seal-home simulation list [--limit 50] --corp seal-home simulation get --corp @@ -247,7 +247,7 @@ seal-home approval-runs bridge --corp --sourceDocumentSN +seal-home simulation create --mode hosecloud --flow-ids "B26017701,B26022501" --reject-node 财务 --thinking-depth medium --skip-invoice-generation --corp # 材料包导入: 先上传材料包 ZIP(服务端解析并返回 schemaConfig), 再用返回的 id 发起 seal-home simulation package-upload 测试材料包.zip --corp seal-home simulation create --mode material_pack --package-ids --package-label 名称 --template-id conference_reimbursement_v1 --schema-config schema.json --corp diff --git a/src/cli/runner.ts b/src/cli/runner.ts index 79f32fa..1fcce88 100755 --- a/src/cli/runner.ts +++ b/src/cli/runner.ts @@ -733,7 +733,6 @@ async function dispatch(argv: string[], runtime: CliRuntime) { await runTool("seal_simulation_batch_create", client, corp, { mode, flowIds: splitOption(args.options.flowIds) ?? splitOption(args.options["flow-ids"]), - limit: numberOption(args.options.limit), rejectNodeName: stringOption(args.options.rejectNode) ?? stringOption(args.options["reject-node"]) ?? null, thinkingDepthOverride: stringOption(args.options.thinkingDepth) ?? stringOption(args.options["thinking-depth"]), skipInvoiceGeneration: booleanOption(args.options.skipInvoiceGeneration) ?? booleanOption(args.options["skip-invoice-generation"]), @@ -1621,7 +1620,7 @@ Usage: seal-home approval-runs url --sourceDocumentSN B26022501 [--corp ] seal-home approval-runs bridge [--sourceDocumentSN B26001887] [--corp ] seal-home simulation batch-records [--corp ] - seal-home simulation create --mode hosecloud --flow-ids "B26017701,B26022501" [--limit 2] [--reject-node 财务] [--thinking-depth medium|high] [--skip-invoice-generation|--skip-invoice-generation false] [--corp ] + seal-home simulation create --mode hosecloud --flow-ids "B26017701,B26022501" [--reject-node 财务] [--thinking-depth default|medium|high] [--skip-invoice-generation|--skip-invoice-generation false] [--corp ] seal-home simulation create --mode material_pack --package-ids [--package-label 名称] [--template-id conference_reimbursement_v1] [--schema-config file.json] [--corp ] seal-home simulation list [--limit 50] [--corp ] seal-home simulation get [--corp ] diff --git a/src/domains/seal/simulation.test.ts b/src/domains/seal/simulation.test.ts index 775ebda..831a12a 100644 --- a/src/domains/seal/simulation.test.ts +++ b/src/domains/seal/simulation.test.ts @@ -155,7 +155,7 @@ function fakeContext(): { corp: CorpConfig } { } describe("buildSimulationBatchParams", () => { - test("builds hosecloud request payload without mode-irrelevant fields", () => { + test("builds hosecloud request payload matching the captured create-batch body", () => { const params = buildSimulationBatchParams({ mode: "hosecloud", flowIds: ["B26017701"], @@ -163,47 +163,49 @@ describe("buildSimulationBatchParams", () => { skipExpenseExtraction: true, disableAttachmentCache: false, rejectNodeName: null, - thinkingDepthOverride: "medium", + thinkingDepthOverride: "default", signKey: SIGN_KEY }); expect(params).toEqual({ - approvalCode: "hosecloud", - nodeId: "hosecloud", + dataCollectionMode: "2", + rejectNodeName: null, skipInvoiceGeneration: true, skipExpenseExtraction: true, - flowIds: ["B26017701"], - limit: 1, - dataCollectionMode: "2", disableAttachmentCache: false, - rejectNodeName: null, - signKey: SIGN_KEY, - thinkingDepthOverride: "medium" + thinkingDepthOverride: "default", + sourceSystem: "hosecloud", + flowIds: ["B26017701"], + signKey: SIGN_KEY }); - // 时间范围字段只在对应取数模式下发送 + // approvalCode/nodeId/limit/startTime/endTime 由服务端从请求推导,不进请求体 + expect(params).not.toHaveProperty("approvalCode"); + expect(params).not.toHaveProperty("nodeId"); + expect(params).not.toHaveProperty("limit"); expect(params).not.toHaveProperty("startTime"); expect(params).not.toHaveProperty("endTime"); }); - test("defaults limit to flowIds length and supports node override", () => { + test("supports node override and deep thinking depth", () => { const params = buildSimulationBatchParams({ mode: "hosecloud", flowIds: ["B26010080", "B25011446"], skipExpenseExtraction: false, disableAttachmentCache: true, rejectNodeName: "财务", + thinkingDepthOverride: "high", signKey: SIGN_KEY }); expect(params).toMatchObject({ flowIds: ["B26010080", "B25011446"], - limit: 2, skipInvoiceGeneration: true, skipExpenseExtraction: false, disableAttachmentCache: true, - rejectNodeName: "财务" + rejectNodeName: "财务", + thinkingDepthOverride: "high" }); - expect(params.thinkingDepthOverride).toBeUndefined(); + expect(params).not.toHaveProperty("limit"); }); test("builds material_pack payload with the confirmed schema config", () => { @@ -229,22 +231,23 @@ describe("buildSimulationBatchParams", () => { }); expect(params).toMatchObject({ - approvalCode: "material_pack", - nodeId: "material_pack", + sourceSystem: "material_pack", packageIds: ["019fd15c-13a6-748f-8cdd-73e2da60252a"], packageLabel: "Hilton测试材料包3-ready-v2-20260805-c6fcc0db", templateId: "conference_reimbursement_v1", runMode: "import_and_simulate", + thinkingDepthOverride: "default", schemaConfig: { id: "conference_reimbursement_v1", mainKeyColumn: "会议编号", attachmentFieldKey: "supporting_files" } }); - // 合思专属字段不随材料包模式发送 + // 合思专属字段不随材料包模式发送; approvalCode/nodeId 由服务端推导 + expect(params).not.toHaveProperty("approvalCode"); expect(params).not.toHaveProperty("disableAttachmentCache"); expect(params).not.toHaveProperty("flowIds"); - expect(params).not.toHaveProperty("startTime"); + expect(params).not.toHaveProperty("dataCollectionMode"); }); test("rawParams can introduce reserved time-range fields", () => { @@ -412,17 +415,17 @@ describe("simulation tool handlers", () => { const result = await handler(client, { mode: "hosecloud", flowIds: ["B26017701"], - limit: 1, - thinkingDepthOverride: "medium" + thinkingDepthOverride: "default" }, fakeContext()); expect(assertPosted).toBe(true); expect(postedBody).toMatchObject({ flowIds: ["B26017701"], - limit: 1, signKey: SIGN_KEY, - thinkingDepthOverride: "medium" + thinkingDepthOverride: "default", + sourceSystem: "hosecloud" }); + expect(postedBody).not.toHaveProperty("limit"); expect(result).toMatchObject({ batchId: "batch-1", created: true }); }); diff --git a/src/domains/seal/tools.ts b/src/domains/seal/tools.ts index ac6222e..6d43440 100644 --- a/src/domains/seal/tools.ts +++ b/src/domains/seal/tools.ts @@ -1074,9 +1074,8 @@ export const sealTools = [ parameters: z.object({ mode: z.enum(["hosecloud", "material_pack"]).default("hosecloud").describe("来源模式: hosecloud=合思指定单号; material_pack=材料包导入"), flowIds: z.array(z.string()).max(100).optional().describe("合思模式: 单据流水号列表"), - limit: z.number().int().positive().max(100).optional().describe("指定单号数量, 默认取 flowIds 个数"), - rejectNodeName: z.string().nullable().optional().describe("仅关注特定节点: 节点名称, 不传为 null 表示不限制"), - thinkingDepthOverride: z.enum(["medium", "high"]).nullable().optional().describe("思考深度: medium=标准, high=深度推理, 不传=按偏好设置"), + rejectNodeName: z.string().nullable().optional().describe("仅关注特定节点: 节点名称, 不设为 null 表示不限制"), + thinkingDepthOverride: z.enum(["default", "medium", "high"]).optional().describe("思考深度: default=按偏好设置, medium=标准, high=深度推理"), skipInvoiceGeneration: z.boolean().optional().describe("跳过发票生成, 默认 true"), skipExpenseExtraction: z.boolean().optional().describe("跳过费用提取, 默认 true"), disableAttachmentCache: z.boolean().optional().describe("不使用附件缓存, 默认 false"), @@ -1092,9 +1091,8 @@ export const sealTools = [ params: { mode?: "hosecloud" | "material_pack"; flowIds?: string[]; - limit?: number; rejectNodeName?: string | null; - thinkingDepthOverride?: "medium" | "high" | null; + thinkingDepthOverride?: "default" | "medium" | "high"; skipInvoiceGeneration?: boolean; skipExpenseExtraction?: boolean; disableAttachmentCache?: boolean; @@ -1119,9 +1117,8 @@ export const sealTools = [ const payload = buildSimulationBatchParams({ mode, flowIds: params.flowIds, - limit: params.limit, rejectNodeName: params.rejectNodeName, - thinkingDepthOverride: params.thinkingDepthOverride ?? undefined, + thinkingDepthOverride: params.thinkingDepthOverride, skipInvoiceGeneration: params.skipInvoiceGeneration, skipExpenseExtraction: params.skipExpenseExtraction, disableAttachmentCache: params.disableAttachmentCache, @@ -1548,9 +1545,8 @@ function pickRuleFields(rule: ApprovalRule, fields: readonly RuleField[]) { export type SimulationBatchCreateInput = { mode: "hosecloud" | "material_pack"; flowIds?: string[]; - limit?: number; rejectNodeName?: string | null; - thinkingDepthOverride?: "medium" | "high"; + thinkingDepthOverride?: "default" | "medium" | "high"; skipInvoiceGeneration?: boolean; skipExpenseExtraction?: boolean; disableAttachmentCache?: boolean; @@ -1564,38 +1560,46 @@ export type SimulationBatchCreateInput = { }; export function buildSimulationBatchParams(input: SimulationBatchCreateInput): Record { + // 请求体按前端真实载荷建模: approvalCode/nodeId/limit/startTime/endTime 由服务端 + // 从 sourceSystem/flowIds 推导,回显 params 是归一化结果,不是请求体本身。 const params: Record = { - approvalCode: input.mode, - nodeId: input.mode, skipInvoiceGeneration: input.skipInvoiceGeneration ?? true, - skipExpenseExtraction: input.skipExpenseExtraction ?? true + skipExpenseExtraction: input.skipExpenseExtraction ?? true, + thinkingDepthOverride: input.thinkingDepthOverride ?? "default" }; + if (input.mode === "hosecloud") { if (!input.flowIds?.length) { throw new Error("hosecloud 模式需要提供 flowIds(单号列表)"); } Object.assign(params, { - flowIds: input.flowIds, - limit: input.limit ?? input.flowIds.length, dataCollectionMode: "2", - disableAttachmentCache: input.disableAttachmentCache ?? false + rejectNodeName: input.rejectNodeName ?? null, + skipInvoiceGeneration: input.skipInvoiceGeneration ?? true, + skipExpenseExtraction: input.skipExpenseExtraction ?? true, + disableAttachmentCache: input.disableAttachmentCache ?? false, + thinkingDepthOverride: input.thinkingDepthOverride ?? "default", + sourceSystem: "hosecloud", + flowIds: input.flowIds }); if (input.signKey) params.signKey = input.signKey; - if (input.rejectNodeName !== undefined) params.rejectNodeName = input.rejectNodeName; } else { if (!input.packageIds?.length) { throw new Error("material_pack 模式需要提供 packageIds(材料包 id)"); } Object.assign(params, { + sourceSystem: "material_pack", packageIds: input.packageIds, - runMode: "import_and_simulate" + runMode: "import_and_simulate", + skipInvoiceGeneration: input.skipInvoiceGeneration ?? true, + skipExpenseExtraction: input.skipExpenseExtraction ?? true, + thinkingDepthOverride: input.thinkingDepthOverride ?? "default" }); if (input.templateId) params.templateId = input.templateId; if (input.packageLabel) params.packageLabel = input.packageLabel; if (input.schemaConfig !== undefined) params.schemaConfig = input.schemaConfig; } - if (input.thinkingDepthOverride) params.thinkingDepthOverride = input.thinkingDepthOverride; if (input.rawParams) Object.assign(params, input.rawParams); return params; } diff --git a/src/domains/seal/types.ts b/src/domains/seal/types.ts index c00b139..3095c77 100644 --- a/src/domains/seal/types.ts +++ b/src/domains/seal/types.ts @@ -359,7 +359,7 @@ export const SimulationBatchParamsSchema = z.object({ skipInvoiceGeneration: z.boolean().optional(), skipExpenseExtraction: z.boolean().optional(), disableAttachmentCache: z.boolean().optional(), - thinkingDepthOverride: z.enum(["medium", "high"]).optional(), + thinkingDepthOverride: z.enum(["default", "medium", "high"]).optional(), // 预留:合思时间范围等其他取数模式 startTime: z.number().optional(), endTime: z.number().optional(),