Make a Base Asset and extend off of it

This commit is contained in:
Nate Kelley 2025-09-17 14:58:39 -06:00
parent 9e0ff140cd
commit d5f43fbcf4
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
2 changed files with 7 additions and 11 deletions

View File

@ -1,11 +1,9 @@
import { z } from 'zod';
export const AssetTypeSchema = z.enum([
'chat',
'metric_file',
'dashboard_file',
'report_file',
'collection',
]);
export const BaseAssetTypeSchema = z.enum(['metric_file', 'dashboard_file', 'report_file']);
export type BaseAssetType = z.infer<typeof BaseAssetTypeSchema>;
export const AssetTypeSchema = z.enum([...BaseAssetTypeSchema.options, 'chat', 'collection']);
export type AssetType = z.infer<typeof AssetTypeSchema>;

View File

@ -1,5 +1,5 @@
import type { ChatMessageReasoningMessage, ChatMessageResponseMessage } from '@buster/database';
import { z } from 'zod';
import { AssetTypeSchema, BaseAssetTypeSchema } from '../assets/asset-types.types';
import { PostProcessingMessageSchema } from '../message';
// Re-create the schemas locally to avoid ESM/CommonJS issues
@ -56,9 +56,7 @@ const ReasoningMessage_TextSchema = z.object({
});
const ReasoningFileTypeSchema = z.enum([
'metric_file',
'dashboard_file',
'report_file',
...BaseAssetTypeSchema.options,
'reasoning',
'agent-action',
'todo',