mirror of
https://wget.la/https://github.com/Wxw-Gu/WechatExplorer
synced 2026-11-30 16:02:58 +08:00
feat: 新增实验性微信卡片分享与自动部署能力
补充 Cloudflare Worker、R2 存储、微信 JS-SDK 签名与上传鉴权 增加自动部署 Skill 和配置引导文档 优化报告工具栏、微信卡片弹窗及窄屏响应式布局 补充 Worker 鉴权、卡片生成、过期清理与安全转义测试
This commit is contained in:
1 parent
eb4cb30fb5
commit
cd2fb09e02
45 files changed
+3832
-69
No files matched your search
@@ -74,6 +74,17 @@ export interface AIRuntimeModelConfig {
|
||||
timeoutMs?: number
|
||||
}
|
||||
|
||||
/** 日报工作区内可选择的模型,不会修改全局默认 Provider。 */
|
||||
export interface ReportModelChoice extends AIRuntimeModelConfig {
|
||||
providerId: string
|
||||
configured: true
|
||||
}
|
||||
|
||||
export interface AIVisionRuntimeConfig extends AIRuntimeModelConfig {
|
||||
/** 图片理解模型独立于文字总结模型,由已验证的 vision/ocr capability 自动选择。 */
|
||||
source: 'default-model' | 'vision-capability' | 'unavailable'
|
||||
}
|
||||
|
||||
export interface AiSearchProviderStatus {
|
||||
configured: boolean
|
||||
requiresConsent: boolean
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -27,6 +27,10 @@ export interface GeneratedReportRecord {
|
||||
height: number
|
||||
}
|
||||
duration?: number
|
||||
/** 文字总结模型;modelName 保留为旧记录兼容字段。 */
|
||||
textModelName?: string
|
||||
/** 图片理解模型。 */
|
||||
imageModelName?: string
|
||||
modelName?: string
|
||||
tokenUsage?: {
|
||||
input?: number
|
||||
@@ -62,6 +66,8 @@ export interface SaveGeneratedReportRequest {
|
||||
htmlPath?: string
|
||||
pngPath?: string
|
||||
duration?: number
|
||||
textModelName?: string
|
||||
imageModelName?: string
|
||||
modelName?: string
|
||||
tokenUsage?: {
|
||||
input?: number
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
export interface WechatShareServiceConfig {
|
||||
serviceUrl: string
|
||||
uploadToken: string
|
||||
}
|
||||
|
||||
export interface WechatShareServiceConfigResult {
|
||||
success: boolean
|
||||
configured?: boolean
|
||||
serviceUrl?: string
|
||||
error?: string
|
||||
}
|
||||
|
||||
export interface PublishWechatShareCardRequest {
|
||||
pngPath: string
|
||||
title: string
|
||||
description: string
|
||||
expiresInDays?: number
|
||||
}
|
||||
|
||||
export interface PublishWechatShareCardResult {
|
||||
success: boolean
|
||||
cardId?: string
|
||||
shareUrl?: string
|
||||
viewUrl?: string
|
||||
qrCodeDataUrl?: string
|
||||
expiresAt?: string
|
||||
error?: string
|
||||
}
|
||||
Reference in new issue
Block a user