Files
makelore/shared/project-config.ts

28 lines
1001 B
TypeScript

export const PRODUCT_OVERVIEW_FILENAME = 'PRODUCT_OVERVIEW.md';
export const LEGACY_PROMOTION_PLAN_FILENAME = 'PROMOTION_PLAN.md';
export const PROJECT_TYPES = ['mini_game', 'mini_program', 'custom'] as const;
export type ProjectType = (typeof PROJECT_TYPES)[number];
export function isProjectType(value: unknown): value is ProjectType {
return typeof value === 'string' && PROJECT_TYPES.includes(value as ProjectType);
}
export type ProjectAgentResponsibility = {
mission: string;
owns: string[];
boundaries: string[];
collaborators: string[];
principles: string[];
};
export const MAX_PROJECT_AGENT_AVATAR_DATA_URL_LENGTH = 800_000;
const PROJECT_AGENT_AVATAR_DATA_URL_PATTERN = /^data:image\/(?:webp|png|jpeg);base64,[A-Za-z0-9+/]+={0,2}$/u;
export function isProjectAgentAvatarDataUrl(value: unknown): value is string {
return typeof value === 'string'
&& value.length <= MAX_PROJECT_AGENT_AVATAR_DATA_URL_LENGTH
&& PROJECT_AGENT_AVATAR_DATA_URL_PATTERN.test(value);
}