forked from EduCraft/curriculum-project-hub
fix: reply to Feishu trigger messages
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { createSdkMcpServer, tool, type McpSdkServerConfigWithInstance } from "@anthropic-ai/claude-agent-sdk";
|
||||
import { z } from "zod";
|
||||
import { sendApprovalCard, sendFile, type FeishuRuntime } from "./client.js";
|
||||
import { sendApprovalCard, sendFile, type FeishuRuntime, type SendMessageOptions } from "./client.js";
|
||||
import { resolveDeliverableFile } from "./fileDelivery.js";
|
||||
import { readFeishuContext } from "./read.js";
|
||||
import type { ApprovalManager } from "./approval.js";
|
||||
@@ -11,6 +11,7 @@ export interface FileDeliveryToolOptions {
|
||||
readonly projectId: string;
|
||||
readonly runId: string;
|
||||
readonly workspaceDir: string;
|
||||
readonly sendOptions?: SendMessageOptions | undefined;
|
||||
readonly approvalManager: ApprovalManager;
|
||||
readonly onDelivered?: (path: string) => void;
|
||||
}
|
||||
@@ -43,7 +44,7 @@ export function createFileDeliveryMcpServer(options: FileDeliveryToolOptions): M
|
||||
};
|
||||
}
|
||||
|
||||
const messageId = await sendFile(options.rt, options.chatId, file.path, args.name ?? file.name);
|
||||
const messageId = await sendFile(options.rt, options.chatId, file.path, args.name ?? file.name, options.sendOptions);
|
||||
if (messageId === null) {
|
||||
return {
|
||||
isError: true,
|
||||
@@ -106,6 +107,7 @@ export function createFileDeliveryMcpServer(options: FileDeliveryToolOptions): M
|
||||
value: option.value,
|
||||
...(option.style === undefined ? {} : { style: option.style }),
|
||||
})),
|
||||
options.sendOptions,
|
||||
);
|
||||
if (messageId === null) {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user