mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-26 21:39:43 +02:00
Merge pull request #1532 from CREDO23/imporve-artifacts-accessibility
[Feat] Artifacts sidebar for chat deliverables
This commit is contained in:
commit
efa9efc80b
40 changed files with 1306 additions and 43 deletions
27
surfsense_web/contracts/types/image-generations.types.ts
Normal file
27
surfsense_web/contracts/types/image-generations.types.ts
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import { z } from "zod";
|
||||
|
||||
// =============================================================================
|
||||
// Image generations — mirror app/schemas/image_generation.py.
|
||||
// =============================================================================
|
||||
|
||||
export const imageGenerationListItem = z.object({
|
||||
id: z.number(),
|
||||
prompt: z.string(),
|
||||
search_space_id: z.number(),
|
||||
created_at: z.string(),
|
||||
is_success: z.boolean(),
|
||||
image_count: z.number().nullish(),
|
||||
});
|
||||
export type ImageGenerationListItem = z.infer<typeof imageGenerationListItem>;
|
||||
|
||||
export const imageGenerationList = z.array(imageGenerationListItem);
|
||||
|
||||
// Detail carries the raw provider response, which holds the displayable image
|
||||
// as either a hosted url or inline base64.
|
||||
export const imageGenerationDetail = z.object({
|
||||
id: z.number(),
|
||||
prompt: z.string(),
|
||||
response_data: z.record(z.string(), z.unknown()).nullish(),
|
||||
error_message: z.string().nullish(),
|
||||
});
|
||||
export type ImageGenerationDetail = z.infer<typeof imageGenerationDetail>;
|
||||
|
|
@ -155,3 +155,16 @@ export const podcastDetail = z.object({
|
|||
thread_id: z.number().nullable(),
|
||||
});
|
||||
export type PodcastDetail = z.infer<typeof podcastDetail>;
|
||||
|
||||
// Lightweight list item — mirror app/podcasts/api/schemas.py PodcastSummary.
|
||||
export const podcastSummary = z.object({
|
||||
id: z.number(),
|
||||
title: z.string(),
|
||||
status: podcastStatus,
|
||||
created_at: z.string(),
|
||||
search_space_id: z.number(),
|
||||
thread_id: z.number().nullish(),
|
||||
});
|
||||
export type PodcastSummary = z.infer<typeof podcastSummary>;
|
||||
|
||||
export const podcastSummaryList = z.array(podcastSummary);
|
||||
|
|
|
|||
25
surfsense_web/contracts/types/reports.types.ts
Normal file
25
surfsense_web/contracts/types/reports.types.ts
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
import { z } from "zod";
|
||||
|
||||
// =============================================================================
|
||||
// Reports — mirror app/schemas/reports.py ReportRead (list view, no content).
|
||||
// Resumes are reports with content_type === "typst".
|
||||
// =============================================================================
|
||||
|
||||
export const reportMetadata = z
|
||||
.object({
|
||||
status: z.enum(["ready", "failed"]).nullish(),
|
||||
word_count: z.number().nullish(),
|
||||
})
|
||||
.nullish();
|
||||
|
||||
export const reportListItem = z.object({
|
||||
id: z.number(),
|
||||
title: z.string(),
|
||||
content_type: z.string().default("markdown"),
|
||||
report_metadata: reportMetadata,
|
||||
thread_id: z.number().nullish(),
|
||||
created_at: z.string(),
|
||||
});
|
||||
export type ReportListItem = z.infer<typeof reportListItem>;
|
||||
|
||||
export const reportList = z.array(reportListItem);
|
||||
20
surfsense_web/contracts/types/video-presentations.types.ts
Normal file
20
surfsense_web/contracts/types/video-presentations.types.ts
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import { z } from "zod";
|
||||
|
||||
// =============================================================================
|
||||
// Video presentations — mirror app/schemas/video_presentations.py status enum.
|
||||
// =============================================================================
|
||||
|
||||
export const videoPresentationStatus = z.enum(["pending", "generating", "ready", "failed"]);
|
||||
export type VideoPresentationStatus = z.infer<typeof videoPresentationStatus>;
|
||||
|
||||
export const videoPresentationListItem = z.object({
|
||||
id: z.number(),
|
||||
title: z.string(),
|
||||
status: videoPresentationStatus.default("ready"),
|
||||
created_at: z.string(),
|
||||
search_space_id: z.number(),
|
||||
thread_id: z.number().nullish(),
|
||||
});
|
||||
export type VideoPresentationListItem = z.infer<typeof videoPresentationListItem>;
|
||||
|
||||
export const videoPresentationList = z.array(videoPresentationListItem);
|
||||
Loading…
Add table
Add a link
Reference in a new issue