dsh-primer 0.4.6 → 0.4.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/data/standards.json +6 -6
- package/dist/dsh-plugin-dev.js +30 -15
- package/package.json +1 -1
package/data/standards.json
CHANGED
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
"33-DSH-BOOST加速实践.md",
|
|
18
18
|
"34-三层分级模型-GB-GBT-GBZ类比.md"
|
|
19
19
|
],
|
|
20
|
-
"auditStatus": "available — the checkers ship in the public dsh-standards package (>=1.6.10) and are no longer private or planned",
|
|
20
|
+
"auditStatus": "available — the checkers ship in the public dsh-standards package (>=1.6.10; baseline 1.6.12) and are no longer private or planned",
|
|
21
21
|
"entryChecker": "40-checker/bin/dsh-plugin-verify.mjs",
|
|
22
22
|
"private": false,
|
|
23
23
|
"packageName": "dsh-standards",
|
|
24
|
-
"packageVersion": "1.6.
|
|
24
|
+
"packageVersion": "1.6.12",
|
|
25
25
|
"packageUrl": "https://www.npmjs.com/package/dsh-standards"
|
|
26
26
|
},
|
|
27
27
|
"disclaimer": "Not an official DeepSeek standard, not a certification, not a security audit, and not a legal GB/GB-T/GB-Z instrument. The GB analogy is a communication aid only. Certification grades A-D are orthogonal to the three levels.",
|
|
@@ -277,15 +277,15 @@
|
|
|
277
277
|
"url": "https://www.npmjs.com/package/dsh-standards",
|
|
278
278
|
"status": "available",
|
|
279
279
|
"command": "dsh-levels <plugin-dir> --no-runtime --format json # bin/dsh-levels.mjs shipped by dsh-standards",
|
|
280
|
-
"note": "Ships in the public npm package dsh-standards (>=1.6.10). Paths are relative to that package root, not to this guide.",
|
|
281
|
-
"package": "dsh-standards@1.6.
|
|
280
|
+
"note": "Ships in the public npm package dsh-standards (>=1.6.10; baseline 1.6.12). Paths are relative to that package root, not to this guide.",
|
|
281
|
+
"package": "dsh-standards@1.6.12"
|
|
282
282
|
},
|
|
283
283
|
"entryChecker": {
|
|
284
284
|
"path": "40-checker/bin/dsh-plugin-verify.mjs",
|
|
285
285
|
"url": "https://www.npmjs.com/package/dsh-standards",
|
|
286
286
|
"command": "node 40-checker/bin/dsh-plugin-verify.mjs <plugin-dir> --scope entry --entry-claim static",
|
|
287
|
-
"package": "dsh-standards@1.6.
|
|
288
|
-
"note": "Ships in the public npm package dsh-standards (>=1.6.10); path relative to that package root."
|
|
287
|
+
"package": "dsh-standards@1.6.12",
|
|
288
|
+
"note": "Ships in the public npm package dsh-standards (>=1.6.10; baseline 1.6.12); path relative to that package root."
|
|
289
289
|
},
|
|
290
290
|
"localStatic": {
|
|
291
291
|
"command": "dsh-plugin-dev check --json",
|
package/dist/dsh-plugin-dev.js
CHANGED
|
@@ -4,7 +4,7 @@ import { tmpdir } from "node:os";
|
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
import { spawn } from "node:child_process";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
//#region src/cli/lib/args.ts
|
|
8
8
|
const LONG_ALIASES = {
|
|
9
9
|
help: "help",
|
|
10
10
|
version: "version"
|
|
@@ -87,7 +87,8 @@ function flagBool(flags, key) {
|
|
|
87
87
|
return flags[key] === true || flags[key] === "true";
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
//#endregion
|
|
91
|
+
//#region src/cli/lib/fs.ts
|
|
91
92
|
/** Fixed temp-dir marker prefix; a security invariant, not a tunable. */
|
|
92
93
|
const TEMP_PREFIX = "dsh-pd-";
|
|
93
94
|
const createdTempDirs = /* @__PURE__ */ new Set();
|
|
@@ -154,7 +155,8 @@ function isDir(path) {
|
|
|
154
155
|
}
|
|
155
156
|
}
|
|
156
157
|
|
|
157
|
-
|
|
158
|
+
//#endregion
|
|
159
|
+
//#region src/cli/templates.ts
|
|
158
160
|
/**
|
|
159
161
|
* The canonical `@deepseek-ai/dsh-*` peer range, single-sourced here and
|
|
160
162
|
* substituted into every scaffolded package.json through the
|
|
@@ -222,7 +224,8 @@ function writeScaffold(targetDir, files) {
|
|
|
222
224
|
for (const file of files) writeFileDeep(join(targetDir, file.relativePath), file.content);
|
|
223
225
|
}
|
|
224
226
|
|
|
225
|
-
|
|
227
|
+
//#endregion
|
|
228
|
+
//#region src/cli/meta.ts
|
|
226
229
|
/** Resolve the installed package root (parent of the templates directory). */
|
|
227
230
|
function resolvePackageRoot() {
|
|
228
231
|
return dirname(resolveTemplatesRoot());
|
|
@@ -232,7 +235,8 @@ function readCliVersion() {
|
|
|
232
235
|
return readJsonIfExists(join(resolvePackageRoot(), "package.json"))?.version ?? "0.0.0";
|
|
233
236
|
}
|
|
234
237
|
|
|
235
|
-
|
|
238
|
+
//#endregion
|
|
239
|
+
//#region src/cli/lib/report.ts
|
|
236
240
|
/** Aggregate a list of checks into a report, deriving `ok` from errors. */
|
|
237
241
|
function buildReport(target, version, checks) {
|
|
238
242
|
const summary = {
|
|
@@ -266,7 +270,8 @@ function renderHuman(report) {
|
|
|
266
270
|
return lines.join("\n");
|
|
267
271
|
}
|
|
268
272
|
|
|
269
|
-
|
|
273
|
+
//#endregion
|
|
274
|
+
//#region src/cli/skill-sections.ts
|
|
270
275
|
/** Canonical skill citation for one check id. */
|
|
271
276
|
const SKILL_SECTIONS = {
|
|
272
277
|
"patch-valid": {
|
|
@@ -359,7 +364,8 @@ function skillRefFor(id) {
|
|
|
359
364
|
};
|
|
360
365
|
}
|
|
361
366
|
|
|
362
|
-
|
|
367
|
+
//#endregion
|
|
368
|
+
//#region src/cli/lib/yaml.ts
|
|
363
369
|
/**
|
|
364
370
|
* Parse a YAML subset document.
|
|
365
371
|
* @param text - raw YAML text.
|
|
@@ -516,7 +522,8 @@ function unescapeDouble(text) {
|
|
|
516
522
|
return text.replace(/\\n/g, "\n").replace(/\\t/g, " ").replace(/\\r/g, "\r").replace(/\\0/g, "\0").replace(/\\"/g, "\"").replace(/\\\\/g, "\\");
|
|
517
523
|
}
|
|
518
524
|
|
|
519
|
-
|
|
525
|
+
//#endregion
|
|
526
|
+
//#region src/cli/commands/check.ts
|
|
520
527
|
/** Icon formats the harness accepts, and its per-file size ceiling. */
|
|
521
528
|
const ICON_EXTENSIONS = [
|
|
522
529
|
".svg",
|
|
@@ -1495,7 +1502,8 @@ function relativePath(root, file) {
|
|
|
1495
1502
|
return file.replace(root.replace(/[\\/]$/, ""), "").replace(/^[\\/]/, "");
|
|
1496
1503
|
}
|
|
1497
1504
|
|
|
1498
|
-
|
|
1505
|
+
//#endregion
|
|
1506
|
+
//#region src/cli/lib/subprocess.ts
|
|
1499
1507
|
/**
|
|
1500
1508
|
* Run a command and capture its output. Uses piped stdio so callers can read
|
|
1501
1509
|
* logs; the process is terminated on timeout or external abort.
|
|
@@ -1596,7 +1604,8 @@ function tailOf(result, lines = 40) {
|
|
|
1596
1604
|
return `${result.stdout}\n${result.stderr}`.trim().split(/\r?\n/).slice(-lines).join("\n");
|
|
1597
1605
|
}
|
|
1598
1606
|
|
|
1599
|
-
|
|
1607
|
+
//#endregion
|
|
1608
|
+
//#region src/cli/commands/new.ts
|
|
1600
1609
|
const NAME_RE = /^[a-z0-9][a-z0-9-]*$/;
|
|
1601
1610
|
/** Normalize and validate a user-supplied plugin name. */
|
|
1602
1611
|
function normalizeName(raw) {
|
|
@@ -1647,7 +1656,8 @@ async function initGit(targetDir) {
|
|
|
1647
1656
|
});
|
|
1648
1657
|
}
|
|
1649
1658
|
|
|
1650
|
-
|
|
1659
|
+
//#endregion
|
|
1660
|
+
//#region src/cli/lib/seams.ts
|
|
1651
1661
|
/** Resolve the index path, tolerating the source tree and the bundled dist. */
|
|
1652
1662
|
function resolveSeamIndexPath() {
|
|
1653
1663
|
const here = dirname(fileURLToPath(import.meta.url));
|
|
@@ -1745,7 +1755,8 @@ function seamsAfter(index, target) {
|
|
|
1745
1755
|
});
|
|
1746
1756
|
}
|
|
1747
1757
|
|
|
1748
|
-
|
|
1758
|
+
//#endregion
|
|
1759
|
+
//#region src/cli/commands/seams.ts
|
|
1749
1760
|
/** Render one seam record as human-readable text. */
|
|
1750
1761
|
function renderSeam(s, out) {
|
|
1751
1762
|
out.push(`${s.id} ${s.title}`);
|
|
@@ -1822,7 +1833,8 @@ function runSeams(index, options) {
|
|
|
1822
1833
|
return 0;
|
|
1823
1834
|
}
|
|
1824
1835
|
|
|
1825
|
-
|
|
1836
|
+
//#endregion
|
|
1837
|
+
//#region src/cli/commands/verify.ts
|
|
1826
1838
|
/**
|
|
1827
1839
|
* The verified harness line `verify` installs into its throwaway profile.
|
|
1828
1840
|
*
|
|
@@ -2076,7 +2088,8 @@ function renderVerifySteps(root, steps) {
|
|
|
2076
2088
|
return lines.join("\n");
|
|
2077
2089
|
}
|
|
2078
2090
|
|
|
2079
|
-
|
|
2091
|
+
//#endregion
|
|
2092
|
+
//#region src/cli/main.ts
|
|
2080
2093
|
const HELP = `dsh-plugin-dev — the DeepSeek Harness plugin-development CLI
|
|
2081
2094
|
|
|
2082
2095
|
Usage:
|
|
@@ -2236,7 +2249,8 @@ async function main(argv, cwd = process.cwd()) {
|
|
|
2236
2249
|
}
|
|
2237
2250
|
}
|
|
2238
2251
|
|
|
2239
|
-
|
|
2252
|
+
//#endregion
|
|
2253
|
+
//#region src/cli/entry.ts
|
|
2240
2254
|
main(process.argv.slice(2)).then((code) => {
|
|
2241
2255
|
process.exitCode = code;
|
|
2242
2256
|
}, (err) => {
|
|
@@ -2244,4 +2258,5 @@ main(process.argv.slice(2)).then((code) => {
|
|
|
2244
2258
|
process.exitCode = 1;
|
|
2245
2259
|
});
|
|
2246
2260
|
|
|
2261
|
+
//#endregion
|
|
2247
2262
|
export { };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-primer",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.7",
|
|
4
4
|
"description": "DSH plugin development as an on-demand agent skill: official docs mirror, version-compatibility matrix, migration seams, measured pitfalls, plus a scaffolder, checker and pack verifier CLI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|