mirror of
https://github.com/cjo4m06/mcp-shrimp-task-manager.git
synced 2025-07-27 08:32:27 +08:00
修正getTaskDetail無法查看記憶區的任務
This commit is contained in:
parent
a5939f2418
commit
a73f3a0105
@ -1473,9 +1473,12 @@ export async function getTaskDetail({
|
|||||||
taskId,
|
taskId,
|
||||||
}: z.infer<typeof getTaskDetailSchema>) {
|
}: z.infer<typeof getTaskDetailSchema>) {
|
||||||
try {
|
try {
|
||||||
// 檢查任務是否存在
|
// 使用 searchTasksWithCommand 替代 getTaskById,實現記憶區任務搜索
|
||||||
const task = await getTaskById(taskId);
|
// 設置 isId 為 true,表示按 ID 搜索;頁碼為 1,每頁大小為 1
|
||||||
if (!task) {
|
const result = await searchTasksWithCommand(taskId, true, 1, 1);
|
||||||
|
|
||||||
|
// 檢查是否找到任務
|
||||||
|
if (result.tasks.length === 0) {
|
||||||
return {
|
return {
|
||||||
content: [
|
content: [
|
||||||
{
|
{
|
||||||
@ -1487,6 +1490,9 @@ export async function getTaskDetail({
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 獲取找到的任務(第一個也是唯一的一個)
|
||||||
|
const task = result.tasks[0];
|
||||||
|
|
||||||
// 使用prompt生成器獲取最終prompt
|
// 使用prompt生成器獲取最終prompt
|
||||||
const prompt = getGetTaskDetailPrompt({
|
const prompt = getGetTaskDetailPrompt({
|
||||||
taskId,
|
taskId,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user