feat: add content type support for reports and include new resume generation tool in dashboard

This commit is contained in:
Anish Sarkar 2026-04-15 21:13:56 +05:30
parent 45eef24dbf
commit 07bd076317
3 changed files with 8 additions and 1 deletions

1
surfsense_web/.npmrc Normal file
View file

@ -0,0 +1 @@
public-hoist-pattern[]=pdfjs-dist

View file

@ -162,6 +162,7 @@ const TOOLS_WITH_UI = new Set([
"web_search",
"generate_podcast",
"generate_report",
"generate_resume",
"generate_video_presentation",
"display_image",
"generate_image",

View file

@ -8,6 +8,8 @@ interface ReportPanelState {
wordCount: number | null;
/** When set, uses public endpoints for fetching report data (public shared chat) */
shareToken: string | null;
/** Content type of the report — "markdown" (default) or "typst" (resume) */
contentType: string;
}
const initialState: ReportPanelState = {
@ -16,6 +18,7 @@ const initialState: ReportPanelState = {
title: null,
wordCount: null,
shareToken: null,
contentType: "markdown",
};
/** Core atom holding the report panel state */
@ -38,7 +41,8 @@ export const openReportPanelAtom = atom(
title,
wordCount,
shareToken,
}: { reportId: number; title: string; wordCount?: number; shareToken?: string | null }
contentType,
}: { reportId: number; title: string; wordCount?: number; shareToken?: string | null; contentType?: string }
) => {
if (!get(reportPanelAtom).isOpen) {
set(preReportCollapsedAtom, get(rightPanelCollapsedAtom));
@ -49,6 +53,7 @@ export const openReportPanelAtom = atom(
title,
wordCount: wordCount ?? null,
shareToken: shareToken ?? null,
contentType: contentType ?? "markdown",
});
set(rightPanelTabAtom, "report");
set(rightPanelCollapsedAtom, false);