bug fixes, and performance improvements, and drawer

This commit is contained in:
Zoe
2026-09-27 18:44:51 -05:00
parent d48d8163a7
commit 2b9f8d64d7
52 changed files with 4913 additions and 778 deletions
+3
View File
@@ -1,4 +1,5 @@
import type { Result } from "../../types/result";
import { randomUUID } from "node:crypto";
import { z } from "zod";
import { Err, Ok } from "../../types/result";
@@ -20,6 +21,7 @@ export const searchOutputSchema = z.object({
results: z.array(z.object({
title: z.string(),
link: z.string(),
sourceId: z.string().describe('Copy this exact ID into [[cite:ID]]. The literal "cite:" prefix is required; [[ID]] is invalid.').optional(),
snippet: z.string(),
})),
warnings: z.array(z.object({ engine: z.string(), reason: z.string() })),
@@ -43,6 +45,7 @@ export const readSearchResponse = (body: unknown): Result<SearchOutput, string>
}
return Ok({
results: parsed.data.results.map(item => ({
sourceId: `s${randomUUID().replaceAll("-", "")}`,
title: item.title,
link: item.url,
snippet: item.content,