openyida 2026.7.6 → 2026.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/scripts/eval/score.js +14 -6
package/package.json
CHANGED
package/scripts/eval/score.js
CHANGED
|
@@ -108,6 +108,18 @@ function buildHumanScores(screenshots = []) {
|
|
|
108
108
|
}));
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
+
function toMarkdownPath(abs, workDir) {
|
|
112
|
+
if (!abs) {return null;}
|
|
113
|
+
if (!workDir) {return abs.replace(/\\/g, '/');}
|
|
114
|
+
|
|
115
|
+
const isWindowsPath = /^[a-zA-Z]:[\\/]/.test(abs) || /^[a-zA-Z]:[\\/]/.test(workDir);
|
|
116
|
+
const relPath = isWindowsPath
|
|
117
|
+
? path.win32.relative(workDir, abs)
|
|
118
|
+
: path.relative(workDir, abs);
|
|
119
|
+
|
|
120
|
+
return (relPath || abs).replace(/\\/g, '/');
|
|
121
|
+
}
|
|
122
|
+
|
|
111
123
|
/**
|
|
112
124
|
* 生成人工打分文档(Markdown),内嵌截图与链接。
|
|
113
125
|
* @param {object} options
|
|
@@ -118,11 +130,6 @@ function buildHumanScores(screenshots = []) {
|
|
|
118
130
|
*/
|
|
119
131
|
function renderScoringMarkdown(options = {}) {
|
|
120
132
|
const { config = {}, scores = [], workDir, rubric = DEFAULT_RUBRIC } = options;
|
|
121
|
-
const rel = (abs) => {
|
|
122
|
-
if (!abs) {return null;}
|
|
123
|
-
if (!workDir) {return abs;}
|
|
124
|
-
return path.relative(workDir, abs) || abs;
|
|
125
|
-
};
|
|
126
133
|
|
|
127
134
|
const lines = [];
|
|
128
135
|
lines.push('# 宜搭应用效果 · 人工打分表');
|
|
@@ -150,7 +157,7 @@ function renderScoringMarkdown(options = {}) {
|
|
|
150
157
|
lines.push('');
|
|
151
158
|
if (s.url) {lines.push(`- 链接:${s.url}`);}
|
|
152
159
|
if (s.screenshot) {
|
|
153
|
-
const relPath =
|
|
160
|
+
const relPath = toMarkdownPath(s.screenshot, workDir);
|
|
154
161
|
lines.push(`- 截图:\`${relPath}\``);
|
|
155
162
|
lines.push('');
|
|
156
163
|
lines.push(``);
|
|
@@ -193,5 +200,6 @@ module.exports = {
|
|
|
193
200
|
autoScoreScreenshots,
|
|
194
201
|
buildHumanScores,
|
|
195
202
|
renderScoringMarkdown,
|
|
203
|
+
toMarkdownPath,
|
|
196
204
|
writeScoringDoc,
|
|
197
205
|
};
|