iter(g37): llms-full 增加组合配方章节

This commit is contained in:
HIsheR
2026-10-26 11:48:31 +08:00
parent 94669974ee
commit 3143a8bd34
5 changed files with 180 additions and 1 deletions
+9
View File
@@ -359,12 +359,21 @@ function renderAgentDocs(index, tokens) {
}
lines.push('---', '');
}
/*** 读取组合配方(与 CLI 同目录的 recipes.md),缺失时返回空串 ***/
function loadRecipes() {
const p = path.join(ROOT, 'packages', 'tools', 'cli', 'recipes.md');
return fs.existsSync(p) ? fs.readFileSync(p, 'utf8').trim() : '';
}
const tokenList = loadTokenList(); // 令牌唯一来源:tokens.css(含字号、间距复合值)
if (tokenList.length) {
lines.push('## 设计令牌(--ua-*)', '');
for (const t of tokenList) lines.push(`- ${t.cssVar}: ${t.value}${t.dark && t.dark !== t.value ? `(暗色 ${t.dark})` : ''}`);
lines.push('', '皮肤包只允许消费这些变量:写死 #hex 会被 verify 拦截,拼错变量名会被令牌引用校验拦截。', '');
}
const recipes = loadRecipes(); // 组合配方:跨组件的拼装指导,清单参数表表达不了
if (recipes) lines.push('', recipes, '');
return lines.join('\n');
}