dsh-score 0.2.26 → 0.2.27
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/CHANGELOG.md +6 -0
- package/README-zh.md +2 -0
- package/README.md +2 -0
- package/lib/index.js +15 -29
- package/lib/types/version.d.ts +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
package/README-zh.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
3
|
# 🏆 dsh-score
|
|
4
|
+
|
|
5
|
+
> **状态:活跃。** 这是本地按需 prior inspector;公共证据层在 [`dsh-attention-index`](https://github.com/PerryLink/dsh-attention-index)。不冻结。
|
|
4
6
|
- **1024 商店渠道**:先 `npm i -g dsh1024`,再 `dsh1024 plugin --profile web add dsh-score`(计入 [deepseek1024.com](https://deepseek1024.com) 安装排行)。
|
|
5
7
|
|
|
6
8
|
**为 DeepSeek Harness 插件提供多指标质量评分。**
|
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
3
|
# 🏆 dsh-score
|
|
4
|
+
|
|
5
|
+
> **Status: active.** This is the local, on-demand prior inspector; the public evidence layer is [`dsh-attention-index`](https://github.com/PerryLink/dsh-attention-index). No FROZEN banner.
|
|
4
6
|
- **1024 store channel**: `npm i -g dsh1024` once, then `dsh1024 plugin --profile web add dsh-score` (counts toward the [deepseek1024.com](https://deepseek1024.com) install ranking).
|
|
5
7
|
[](https://gitee.com/perrylink/dsh-score)
|
|
6
8
|
[](https://dshfind.com/plugins/PerryLink/dsh-score?ref=badge)
|
package/lib/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { dirname, join } from "node:path";
|
|
|
6
6
|
import z$1 from "@deepseek-ai/schemastery";
|
|
7
7
|
import { defineDomain, domainTable } from "@deepseek-ai/dsh-storage-domain";
|
|
8
8
|
import { defineTool } from "@deepseek-ai/dsh-tools";
|
|
9
|
-
|
|
9
|
+
// src/result.ts
|
|
10
10
|
/**
|
|
11
11
|
* The structured scoring contract `dsh-score/v1`: one score card per target,
|
|
12
12
|
* plus the leaderboard record that aggregates them. The zod schemas are the
|
|
@@ -191,8 +191,7 @@ function totalsOf(rows) {
|
|
|
191
191
|
}
|
|
192
192
|
return totals;
|
|
193
193
|
}
|
|
194
|
-
|
|
195
|
-
//#region src/sanitize.ts
|
|
194
|
+
// src/sanitize.ts
|
|
196
195
|
/**
|
|
197
196
|
* Pure sanitizers for every string that reaches a report, a log, or the model.
|
|
198
197
|
* Nothing here reads the environment or the clock: report content is the only
|
|
@@ -291,8 +290,7 @@ function tailText(text, maxChars) {
|
|
|
291
290
|
if (clean.length <= maxChars) return clean;
|
|
292
291
|
return `…<truncated, showing last ${maxChars} chars>…${clean.slice(-maxChars)}`;
|
|
293
292
|
}
|
|
294
|
-
|
|
295
|
-
//#region src/dimensions.ts
|
|
293
|
+
// src/dimensions.ts
|
|
296
294
|
/** Build one audit link for a derived fact. */
|
|
297
295
|
function link(source, detail, now) {
|
|
298
296
|
return {
|
|
@@ -650,8 +648,7 @@ function evaluateAll(input) {
|
|
|
650
648
|
compliance: evaluateCompliance(input)
|
|
651
649
|
};
|
|
652
650
|
}
|
|
653
|
-
|
|
654
|
-
//#region src/probe.ts
|
|
651
|
+
// src/probe.ts
|
|
655
652
|
/**
|
|
656
653
|
* The evidence-gathering layer: runs `gh` and `npm` as managed subprocesses
|
|
657
654
|
* over `ctx.subprocess` and parses their output into structured facts. Every
|
|
@@ -1011,17 +1008,15 @@ function probeFailure(run) {
|
|
|
1011
1008
|
function sanitizeEvidenceDetail(detail) {
|
|
1012
1009
|
return tailText(redactSecrets(detail), 200);
|
|
1013
1010
|
}
|
|
1014
|
-
|
|
1015
|
-
//#region src/version.ts
|
|
1011
|
+
// src/version.ts
|
|
1016
1012
|
/**
|
|
1017
1013
|
* Producer version, kept in lockstep with `package.json` by
|
|
1018
1014
|
* `scripts/release.mjs`; `tests/version.spec.ts` trips when they drift.
|
|
1019
1015
|
* The structured score records it as `score.pluginVersion`.
|
|
1020
1016
|
* @module dsh-score/version
|
|
1021
1017
|
*/
|
|
1022
|
-
const VERSION = "0.2.
|
|
1023
|
-
|
|
1024
|
-
//#region src/score.ts
|
|
1018
|
+
const VERSION = "0.2.27";
|
|
1019
|
+
// src/score.ts
|
|
1025
1020
|
/**
|
|
1026
1021
|
* The single-target scoring pipeline: classify and sanitize the target, gather
|
|
1027
1022
|
* evidence through the {@link ProbeDriver}, read reserved test-drive install
|
|
@@ -1208,8 +1203,7 @@ var ScoreRunner = class {
|
|
|
1208
1203
|
return result;
|
|
1209
1204
|
}
|
|
1210
1205
|
};
|
|
1211
|
-
|
|
1212
|
-
//#region src/batch.ts
|
|
1206
|
+
// src/batch.ts
|
|
1213
1207
|
/**
|
|
1214
1208
|
* The `score-batch` background-job producer over `ctx.jobs`. One job scores a
|
|
1215
1209
|
* list of targets (serially or with bounded concurrency), streams per-target
|
|
@@ -1378,8 +1372,7 @@ function tailDetail(text) {
|
|
|
1378
1372
|
const clean = text.replace(/\s+/gu, " ").trim();
|
|
1379
1373
|
return clean.length <= 200 ? clean : `${clean.slice(0, 197)}…`;
|
|
1380
1374
|
}
|
|
1381
|
-
|
|
1382
|
-
//#region src/command.ts
|
|
1375
|
+
// src/command.ts
|
|
1383
1376
|
/** Split raw command input into target specs (whitespace and commas separate). */
|
|
1384
1377
|
function parseTargets(rawInput) {
|
|
1385
1378
|
return rawInput.split(/[\s,]+/u).map((token) => token.trim()).filter((token) => token.length > 0);
|
|
@@ -1408,8 +1401,7 @@ function handleScore(deps, invocation) {
|
|
|
1408
1401
|
text: `Started background scoring job ${String(jobId)} for ${targets.length} target(s). Progress streams through the job output; the final line names the leaderboard id for score_report.`
|
|
1409
1402
|
};
|
|
1410
1403
|
}
|
|
1411
|
-
|
|
1412
|
-
//#region src/config.ts
|
|
1404
|
+
// src/config.ts
|
|
1413
1405
|
/**
|
|
1414
1406
|
* Plugin configuration and its explicit resolve step. `resolveConfig` re-judges
|
|
1415
1407
|
* every default and bound so programmatic construction that bypasses
|
|
@@ -1524,8 +1516,7 @@ function resolveConfig(config) {
|
|
|
1524
1516
|
weights: Object.freeze(weights)
|
|
1525
1517
|
});
|
|
1526
1518
|
}
|
|
1527
|
-
|
|
1528
|
-
//#region src/domain.ts
|
|
1519
|
+
// src/domain.ts
|
|
1529
1520
|
/**
|
|
1530
1521
|
* The `score` storage domain: the durable home of score cards and leaderboard
|
|
1531
1522
|
* records. Opened through `ctx.storageDomain` (a public service), with record
|
|
@@ -1559,8 +1550,7 @@ const scoreDomainSpec = defineDomain({
|
|
|
1559
1550
|
leaderboards: domainTable(LeaderboardRecordSchema)
|
|
1560
1551
|
}
|
|
1561
1552
|
});
|
|
1562
|
-
|
|
1563
|
-
//#region src/badge.ts
|
|
1553
|
+
// src/badge.ts
|
|
1564
1554
|
/**
|
|
1565
1555
|
* Embeddable README badges and the five-dimension JSON API output. Pure,
|
|
1566
1556
|
* zero-dependency functions over a settled {@link ScoreResult}: a shields.io
|
|
@@ -1796,8 +1786,7 @@ function renderBadgeMarkdown(result) {
|
|
|
1796
1786
|
const message = totalMessage(result);
|
|
1797
1787
|
return `)})`;
|
|
1798
1788
|
}
|
|
1799
|
-
|
|
1800
|
-
//#region src/report.ts
|
|
1789
|
+
// src/report.ts
|
|
1801
1790
|
/** Emoji/symbol mark for a dimension status. */
|
|
1802
1791
|
function statusMark(status) {
|
|
1803
1792
|
switch (status) {
|
|
@@ -1881,8 +1870,7 @@ function renderLeaderboard(record) {
|
|
|
1881
1870
|
}
|
|
1882
1871
|
return lines.join("\n");
|
|
1883
1872
|
}
|
|
1884
|
-
|
|
1885
|
-
//#region src/tools.ts
|
|
1873
|
+
// src/tools.ts
|
|
1886
1874
|
/** JSON-schema fragment for one dimension score. */
|
|
1887
1875
|
const dimensionScoreSchema = {
|
|
1888
1876
|
type: "object",
|
|
@@ -2274,8 +2262,7 @@ function allTools(services) {
|
|
|
2274
2262
|
scoreReport
|
|
2275
2263
|
];
|
|
2276
2264
|
}
|
|
2277
|
-
|
|
2278
|
-
//#region src/index.ts
|
|
2265
|
+
// src/index.ts
|
|
2279
2266
|
const name = "dsh-score";
|
|
2280
2267
|
/**
|
|
2281
2268
|
* Public services only. `storageDomain` is deliberately OPTIONAL: the published
|
|
@@ -2345,5 +2332,4 @@ function apply(ctx, config) {
|
|
|
2345
2332
|
log(`npm CLI unavailable: ${String(error)}`);
|
|
2346
2333
|
});
|
|
2347
2334
|
}
|
|
2348
|
-
//#endregion
|
|
2349
2335
|
export { BADGE_SCHEMA, Config, DIMENSIONS, DIMENSION_BADGE_LABELS, DOMAIN_NAME, DOMAIN_VERSION, LEADERBOARD_ID_PREFIX, LICENSE_ALLOWLIST, LeaderboardRecordSchema, MALICIOUS_SCRIPT_MARKERS, ProbeDriver, REDACTED, RESULT_SCHEMA, SCORE_BATCH_KIND, SCORE_KEY_PREFIX, SECRET_PATTERNS, ScoreResultSchema, ScoreRunner, VERSION, apply, badgeJson, classifyTarget, computeTotal, daysSince, evaluateAll, evaluateCompliance, evaluateDocumentation, evaluateInstall, evaluateMaintenance, evaluateSecurity, extractRepoFromNpmUrl, formatDuration, freshLeaderboardId, gradeColor, gradeOf, hasEvidence, inject, leaderboardSummary, licenseCompliance, name, parseFileList, parseGithubContent, parseLatestCommit, parseNpmShim, parseNpmView, parseOldestOpenIssue, parseRepoMeta, parseRepoRef, parseTargets, progressLine, readTestDriveEvidence, redactSecrets, renderBadgeMarkdown, renderDimensionBadges, renderLeaderboard, renderScoreBadge, renderScoreCard, renderShieldsSvg, resolveConfig, rowOf, runBatch, sanitizeTarget, scanMaliciousScripts, scanSecretPatterns, scoreDomainSpec, scoreKey, shieldsEndpointUrl, startBatchJob, statusColor, statusMark, tailText, totalsOf, verdictOf };
|
package/lib/types/version.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-score",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.27",
|
|
4
4
|
"description": "Multi-dimensional quality scoring for DeepSeek Harness plugins: scores one repo or npm package across install success (consuming dsh-test-drive results), maintenance activity, documentation completeness, security scan, and protocol compliance \u2014 every conclusion backed by real CLI evidence with audit timestamps \u2014 and produces a JSON/Markdown leaderboard report",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -112,14 +112,14 @@
|
|
|
112
112
|
"@deepseek-ai/dsh-storage-domain": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0 || >=0.1.7-0 <0.2.0 || >=0.2.0-0 <0.3.0 || >=0.2.1-0 <0.3.0",
|
|
113
113
|
"@deepseek-ai/dsh-subprocess": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0 || >=0.1.7-0 <0.2.0 || >=0.2.0-0 <0.3.0 || >=0.2.1-0 <0.3.0",
|
|
114
114
|
"@deepseek-ai/dsh-tools": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0 || >=0.1.7-0 <0.2.0 || >=0.2.0-0 <0.3.0 || >=0.2.1-0 <0.3.0",
|
|
115
|
-
"@deepseek-ai/schemastery": "^3.18.5
|
|
115
|
+
"@deepseek-ai/schemastery": "^3.18.5"
|
|
116
116
|
},
|
|
117
117
|
"dependencies": {
|
|
118
118
|
"zod": "4.4.3"
|
|
119
119
|
},
|
|
120
120
|
"devDependencies": {
|
|
121
121
|
"@deepseek-ai/cordis": "^4.0.5",
|
|
122
|
-
"@deepseek-ai/cordis-plugin-include": "^1.0.10
|
|
122
|
+
"@deepseek-ai/cordis-plugin-include": "^1.0.10",
|
|
123
123
|
"@deepseek-ai/cordis-plugin-loader": "^1.0.6",
|
|
124
124
|
"@deepseek-ai/dsh-agent": "0.2.1-rc.2",
|
|
125
125
|
"@deepseek-ai/dsh-attachment": "0.2.1-rc.2",
|
|
@@ -133,14 +133,14 @@
|
|
|
133
133
|
"@deepseek-ai/dsh-subprocess": "0.2.1-rc.2",
|
|
134
134
|
"@deepseek-ai/dsh-subprocess-local": "0.2.1-rc.2",
|
|
135
135
|
"@deepseek-ai/dsh-tools": "0.2.1-rc.2",
|
|
136
|
-
"@deepseek-ai/schemastery": "^3.18.5
|
|
137
|
-
"@types/node": "^22.
|
|
136
|
+
"@deepseek-ai/schemastery": "^3.18.5",
|
|
137
|
+
"@types/node": "^22.20.5",
|
|
138
138
|
"@vitest/coverage-v8": "3.2.7",
|
|
139
139
|
"oxlint": "0.18.1",
|
|
140
140
|
"vitest": "^3.2.0",
|
|
141
141
|
"zod": "^4.4.3",
|
|
142
142
|
"@deepseek-ai/dsh-working-directory": "0.2.1-rc.2",
|
|
143
|
-
"tsdown": "^0.
|
|
143
|
+
"tsdown": "^0.23.1",
|
|
144
144
|
"typescript": "^5.9.0"
|
|
145
145
|
},
|
|
146
146
|
"scripts": {
|