chore: uncomment feature code

This commit is contained in:
Ou
2025-05-10 18:31:45 +08:00
parent 7f9591f465
commit 1fb665be18
2 changed files with 1326 additions and 1397 deletions
+1316 -1380
View File
File diff suppressed because it is too large Load Diff
+10 -17
View File
@@ -20,28 +20,21 @@ export function getServer() {
id: z.string().describe(`source id. e.g. ${description}`),
count: z.any().default(10).describe("count of news to return."),
},
async ({ count }): Promise<CallToolResult> => {
async ({ id, count }): Promise<CallToolResult> => {
let n = Number(count)
if (Number.isNaN(n) || n < 1) {
n = 10
}
await delay(5000)
return {
content: [{
text: "hello",
type: "text",
}],
}
// const res: SourceResponse = await $fetch(`https://newsnow.busiyi.world/api/s?id=${id}`)
// return {
// content: res.items.slice(0, count).map((item) => {
// return {
// text: `[${item.title}](${item.url})`,
// type: "text",
// }
// }),
// }
const res: SourceResponse = await $fetch(`/api/s?id=${id}`)
return {
content: res.items.slice(0, count).map((item) => {
return {
text: `[${item.title}](${item.url})`,
type: "text",
}
}),
}
},
)