@lmzhen/dsh-evolution-merge-engine 0.30.38 → 0.30.40
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/lib/build-manifest.json +5 -5
- package/lib/index.js +6 -4
- package/package.json +1 -1
package/lib/build-manifest.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"version": "0.30.
|
|
4
|
-
"sourceBundleSha256": "
|
|
5
|
-
"sourceBundleBytes":
|
|
6
|
-
"outputSha256": "
|
|
7
|
-
"outputBytes":
|
|
3
|
+
"version": "0.30.40",
|
|
4
|
+
"sourceBundleSha256": "66a083d3b35ecdd2a6adee0d3ee9bf5bf2e7d95631a5d42d61671b1c65115415",
|
|
5
|
+
"sourceBundleBytes": 270840,
|
|
6
|
+
"outputSha256": "ed170ac87bac3e069d7c3c840604a5f09752a6156e437754f1517e4aa4d3a53f",
|
|
7
|
+
"outputBytes": 270841,
|
|
8
8
|
"assets": [
|
|
9
9
|
{
|
|
10
10
|
"path": "data/minhash_params.json",
|
package/lib/index.js
CHANGED
|
@@ -2397,12 +2397,13 @@ import path9 from "node:path";
|
|
|
2397
2397
|
import crypto2 from "node:crypto";
|
|
2398
2398
|
var FM_RE = /^---\s*\n([\s\S]*?)\n---\s*\n?/;
|
|
2399
2399
|
var Skill = class {
|
|
2400
|
-
constructor(p, name, description, body) {
|
|
2400
|
+
constructor(p, name, description, body, whenToUse) {
|
|
2401
2401
|
this.path = p;
|
|
2402
2402
|
this.name = name;
|
|
2403
2403
|
this.description = description;
|
|
2404
2404
|
this.body = body;
|
|
2405
2405
|
this.body_core = "";
|
|
2406
|
+
this.whenToUse = typeof whenToUse === "string" ? whenToUse : "";
|
|
2406
2407
|
}
|
|
2407
2408
|
get summary() {
|
|
2408
2409
|
return (this.name + " " + this.description).trim();
|
|
@@ -2414,7 +2415,7 @@ function frontmatter(text) {
|
|
|
2414
2415
|
const fm = {};
|
|
2415
2416
|
for (const rawLine of m[1].split(/\r?\n/)) {
|
|
2416
2417
|
const line = rawLine.trim();
|
|
2417
|
-
const mm = /^(name|description|tags)\s*:\s*(.*)$/.exec(line);
|
|
2418
|
+
const mm = /^(name|description|whenToUse|tags)\s*:\s*(.*)$/.exec(line);
|
|
2418
2419
|
if (!mm) continue;
|
|
2419
2420
|
let v = mm[2].trim();
|
|
2420
2421
|
if (v.length >= 2 && (v[0] === '"' || v[0] === "'") && v[v.length - 1] === v[0]) v = v.slice(1, -1);
|
|
@@ -2462,7 +2463,7 @@ function loadCorpus(roots) {
|
|
|
2462
2463
|
}
|
|
2463
2464
|
const [fm, body] = frontmatter(text);
|
|
2464
2465
|
const name = fm.name || path9.basename(dir);
|
|
2465
|
-
skills.push(new Skill(p, name, fm.description || "", body));
|
|
2466
|
+
skills.push(new Skill(p, name, fm.description || "", body, fm.whenToUse || ""));
|
|
2466
2467
|
return;
|
|
2467
2468
|
}
|
|
2468
2469
|
for (const d of keep) walk(path9.join(dir, d));
|
|
@@ -3207,6 +3208,7 @@ function sections(body) {
|
|
|
3207
3208
|
function headExtract(skill, maxChars) {
|
|
3208
3209
|
const mc = maxChars || 2400;
|
|
3209
3210
|
const parts = [String(skill.description).trim()];
|
|
3211
|
+
if (skill.whenToUse) parts.push(String(skill.whenToUse).trim());
|
|
3210
3212
|
const secs = sections(skill.body_core || skill.body);
|
|
3211
3213
|
if (secs.length) parts.push(secs[0][1]);
|
|
3212
3214
|
const when = secs.filter(([h]) => WHEN_RE.test(h)).map(([, t]) => t);
|
|
@@ -5627,7 +5629,7 @@ import { dirname, join } from "node:path";
|
|
|
5627
5629
|
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
5628
5630
|
import path22 from "node:path";
|
|
5629
5631
|
var ROOT = join(dirname(fileURLToPath4(import.meta.url)), "..");
|
|
5630
|
-
var VERSION = "0.30.
|
|
5632
|
+
var VERSION = "0.30.40";
|
|
5631
5633
|
function registrySha() {
|
|
5632
5634
|
const p = join(ROOT, "vendor", "skill-merge-pipeline", "models", "registry.json");
|
|
5633
5635
|
return existsSync(p) ? createHash("sha256").update(readFileSync(p)).digest("hex") : "";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lmzhen/dsh-evolution-merge-engine",
|
|
3
3
|
"description": "Vendored skill-merge Node pipeline engine (byte-identical upstream) for DSH evolution-merge (community build)",
|
|
4
|
-
"version": "0.30.
|
|
4
|
+
"version": "0.30.40",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/index.d.ts",
|