初始化 M0:Astro SSR + node:sqlite 脚手架与只读页面

This commit is contained in:
zhongluofeng authored and trae-solo-agent committed 2026-10-30 15:34:50 +08:00
1 parent 97440b4120
commit 8430e5304d
39 files changed
+6398 -1

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
import { z } from 'zod';
/** 字段置信度:AI 分级录入的唯一依据 */
export const confidenceSchema = z.enum(['high', 'medium', 'low']);
export type Confidence = z.infer<typeof confidenceSchema>;
/**
* 字段级元数据。path 是扁平路径(如 specs.rearCamera[0].sensorModel),
* 与 AI 接口返回的字段路径一一对应。
*/
export const fieldMetaSchema = z.object({
path: z.string(),
confidence: confidenceSchema,
sourceUrl: z.url().optional(),
verified: z.boolean().default(false),
capturedAt: z.string(),
});
export type FieldMeta = z.infer<typeof fieldMetaSchema>;
/** ISO 日期字符串(只到日或 datetime 均可) */
export const dateStringSchema = z.string().refine((v) => !Number.isNaN(new Date(v).getTime()), {
message: '不是有效日期',
});