feat: 新增实验性微信卡片分享与自动部署能力

补充 Cloudflare Worker、R2 存储、微信 JS-SDK 签名与上传鉴权
增加自动部署 Skill 和配置引导文档
优化报告工具栏、微信卡片弹窗及窄屏响应式布局
补充 Worker 鉴权、卡片生成、过期清理与安全转义测试
This commit is contained in:
Wxw-Gu committed 2026-08-13 10:48:07 +08:00
1 parent eb4cb30fb5
commit cd2fb09e02
45 files changed
+3832 -69

No files matched your search

+19 -2
View File
@@ -12,6 +12,21 @@ export type ImageCategory =
export type ImageImportance = 'low' | 'medium' | 'high'
/** 日报图片理解结果最多复用 10 分钟;旧记录保留在磁盘,仅不再作为缓存命中。 */
export const IMAGE_INSIGHT_CACHE_TTL_MS = 10 * 60 * 1000
export const isFreshImageInsight = (
insight: Pick<ImageInsight, 'updatedAt'> | null | undefined,
now = Date.now()
): boolean =>
Boolean(
insight &&
Number.isFinite(insight.updatedAt) &&
insight.updatedAt > 0 &&
now >= insight.updatedAt &&
now - insight.updatedAt < IMAGE_INSIGHT_CACHE_TTL_MS
)
/**
* 单张微信图片的 AI 理解结果(持久化到 image-insights.json)
*
@@ -57,6 +72,9 @@ export interface ImageAnalysisRequest {
sender: string
sentAt: number
sessionId: string
/** 日报局部选择的图片理解模型;未传时仍使用自动视觉路由。 */
providerId?: string
modelId?: string
/** 强制重新分析(忽略缓存) */
force?: boolean
}
@@ -118,8 +136,7 @@ export interface ImageCandidateQuery {
export const isHotImageCandidate = (input: {
responseCount: number
interactionCount: number
}): boolean =>
input.responseCount >= 2 || (input.responseCount >= 1 && input.interactionCount >= 1)
}): boolean => input.responseCount >= 2 || (input.responseCount >= 1 && input.interactionCount >= 1)
export const calculateImageHeatScore = (input: {
responseCount: number