Add market watch and match hub workflows

这个提交包含在:
cryptocommuniums-afk
2026-04-07 11:00:03 +08:00
父节点 495da60212
当前提交 32ffad1545
修改 39 个文件,包含 6974 行新增330 行删除

查看文件

@@ -17,6 +17,20 @@ type RecentAnalysis = {
fluidityScore: number | null;
};
type TrainingAssessmentSnapshot = {
heightCm: number | null;
weightKg: number | null;
sprintSpeedScore: number | null;
explosivePowerScore: number | null;
agilityScore: number | null;
enduranceScore: number | null;
flexibilityScore: number | null;
coreStabilityScore: number | null;
shoulderMobilityScore: number | null;
hipMobilityScore: number | null;
assessmentNotes: string | null;
};
function skillLevelLabel(skillLevel: "beginner" | "intermediate" | "advanced") {
switch (skillLevel) {
case "intermediate":
@@ -33,17 +47,43 @@ export function buildTrainingPlanPrompt(input: {
durationDays: number;
focusAreas?: string[];
recentScores: RecentScore[];
effectiveNtrpRating: number;
ntrpSource: "system" | "manual" | "default";
assessmentSnapshot: TrainingAssessmentSnapshot;
}) {
const assessmentLines = [
`- 身高:${input.assessmentSnapshot.heightCm ?? "未知"} cm`,
`- 体重:${input.assessmentSnapshot.weightKg ?? "未知"} kg`,
`- 速度:${input.assessmentSnapshot.sprintSpeedScore ?? "未知"}/5`,
`- 爆发力:${input.assessmentSnapshot.explosivePowerScore ?? "未知"}/5`,
`- 敏捷性:${input.assessmentSnapshot.agilityScore ?? "未知"}/5`,
`- 耐力:${input.assessmentSnapshot.enduranceScore ?? "未知"}/5`,
`- 柔韧性:${input.assessmentSnapshot.flexibilityScore ?? "未知"}/5`,
`- 核心稳定性:${input.assessmentSnapshot.coreStabilityScore ?? "未知"}/5`,
`- 肩部灵活性:${input.assessmentSnapshot.shoulderMobilityScore ?? "未知"}/5`,
`- 髋部灵活性:${input.assessmentSnapshot.hipMobilityScore ?? "未知"}/5`,
input.assessmentSnapshot.assessmentNotes?.trim()
? `- 额外备注:${input.assessmentSnapshot.assessmentNotes.trim()}`
: null,
].filter(Boolean);
return [
`你是一位专业网球教练。请为一位${skillLevelLabel(input.skillLevel)}水平的网球学员生成 ${input.durationDays} 天训练计划。`,
"训练条件与要求:",
"- 训练以个人可执行为主,可使用球拍、弹力带、标志盘、墙面等常见器材。",
"- 每天训练 30-60 分钟,结构要清晰:热身、专项、脚步、力量/稳定、放松。",
"- 输出内容要适合直接执行,不写空话,不写营销语,不写额外说明。",
"- 必须返回合法 JSON,title 不能为空,exercises 数组不能为空。",
`- exercises 总数至少 ${Math.max(input.durationDays * 3, 6)} 项,每一天至少 3 个训练项。`,
"- 每个训练项都必须包含 day、name、category、duration、description、tips、sets、reps。",
input.focusAreas?.length ? `- 重点关注:${input.focusAreas.join("、")}` : "- 如未指定重点,请自动平衡技术、脚步和体能。",
`- 当前 NTRP 参考值:${input.effectiveNtrpRating.toFixed(1)}(来源:${input.ntrpSource === "system" ? "系统判定" : input.ntrpSource === "manual" ? "人工基线" : "默认基线"}`,
"用户当前训练档案:",
...assessmentLines,
input.recentScores.length > 0
? `- 用户最近分析摘要:${JSON.stringify(input.recentScores)}`
: "- 暂无历史分析数据,请基于该水平的常见薄弱项设计。",
"请根据身体指标调整训练强度和训练比重:速度/敏捷不足时增加脚步与启动训练,核心或灵活性不足时增加稳定性与活动度训练。",
"每个训练项都要给出目标、动作描述、组次/次数、关键提示,避免重复堆砌。",
].join("\n");
}