@lmzhen/dsh-evolution-core 0.53.0 → 0.55.0

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.
Files changed (53) hide show
  1. package/lib/{extract-plan-D4zO7dmD.js → extract-plan-ihQznLVT.js} +2 -1
  2. package/lib/extract.js +7 -7
  3. package/lib/index.js +795 -546
  4. package/lib/{limits-TD4Pv92Q.js → limits-DBg3UMkw.js} +11 -6
  5. package/lib/{skill-history-CZp8vhyL.js → mutation-storage-adapter-BM7mIJKp.js} +4 -647
  6. package/lib/mutations-1wLISSrY.js +592 -0
  7. package/lib/policy.js +9 -3
  8. package/lib/{quality-BLc6UQQb.js → quality-DNUVRbUm.js} +1 -1
  9. package/lib/{skill-health-BIpiPvw6.js → review-context-CXKwGGd8.js} +124 -183
  10. package/lib/runtime/plugin.js +92 -1
  11. package/lib/{session-projection-ByNxQi9O.js → session-projection-CbIKvDfJ.js} +3 -2
  12. package/lib/skill-history-B-DyIedq.js +646 -0
  13. package/lib/skills.js +12 -8
  14. package/lib/text-metrics-CyJhxWBs.js +132 -0
  15. package/lib/types/constants.d.ts +10 -5
  16. package/lib/types/constants.js +10 -5
  17. package/lib/types/drift-signals.d.ts +1 -4
  18. package/lib/types/drift-signals.js +14 -23
  19. package/lib/types/extract-request.js +3 -2
  20. package/lib/types/frontmatter.js +12 -8
  21. package/lib/types/index.d.ts +2 -1
  22. package/lib/types/index.js +2 -1
  23. package/lib/types/memory-store.d.ts +32 -6
  24. package/lib/types/memory-store.js +86 -30
  25. package/lib/types/mutation-unit.js +2 -1
  26. package/lib/types/params.js +6 -3
  27. package/lib/types/policy.d.ts +5 -0
  28. package/lib/types/policy.js +8 -2
  29. package/lib/types/prompts.d.ts +1 -1
  30. package/lib/types/prompts.js +1 -1
  31. package/lib/types/runtime/coherence.d.ts +27 -0
  32. package/lib/types/runtime/coherence.js +115 -0
  33. package/lib/types/runtime/plugin.js +2 -0
  34. package/lib/types/signals.js +3 -2
  35. package/lib/types/skill-health.d.ts +8 -5
  36. package/lib/types/skill-health.js +27 -28
  37. package/lib/types/skill-history.d.ts +2 -2
  38. package/lib/types/skill-history.js +7 -7
  39. package/lib/types/skill-lint.d.ts +1 -1
  40. package/lib/types/skill-lint.js +4 -4
  41. package/lib/types/skill-stats.d.ts +3 -1
  42. package/lib/types/skill-stats.js +2 -0
  43. package/lib/types/skill-store.js +2 -1
  44. package/lib/types/text-budgets.d.ts +150 -0
  45. package/lib/types/text-budgets.js +65 -0
  46. package/lib/types/text-metrics.d.ts +88 -0
  47. package/lib/types/text-metrics.js +131 -0
  48. package/lib/{usage-B1qveKi9.js → usage-e34VZPmK.js} +2 -515
  49. package/lib/write.js +3 -2
  50. package/package.json +1 -1
  51. package/lib/mutations-DQXddSJd.js +0 -75
  52. package/lib/types/cost.d.ts +0 -63
  53. package/lib/types/cost.js +0 -67
@@ -1,4 +1,5 @@
1
- import { F as frontmatterBlock, G as supportRefs, J as planReferenceRewrite, K as applyReferenceRewrite, O as selectSections, W as externalRefs, Y as planRehoming } from "./usage-B1qveKi9.js";
1
+ import { I as planReferenceRewrite, L as planRehoming, M as externalRefs, N as supportRefs, O as selectSections, P as applyReferenceRewrite } from "./usage-e34VZPmK.js";
2
+ import { u as frontmatterBlock } from "./mutations-1wLISSrY.js";
2
3
  import { createHash } from "node:crypto";
3
4
  //#region lib/types/extract-plan.js
4
5
  const LF = String.fromCharCode(10);
package/lib/extract.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { p as isPresent } from "./io-GxghO3Ip.js";
2
- import { i as DEFAULT_SKILL_LIMITS } from "./limits-TD4Pv92Q.js";
3
- import { R as parseFrontmatter } from "./usage-B1qveKi9.js";
4
- import { C as EXTRACT_PROMPT_VERSION, S as EXTRACT_PROMPT_V1, T as ownerCandidatesFromSummaries, _ as readProposalReport, b as proposalFromPlan, d as nearDuplicateSummaries, m as readExternalSupport, v as readProposalReports, w as findOwnerCandidate, x as EXTRACT_PROMPT_HASH, y as writeProposalReport } from "./quality-BLc6UQQb.js";
5
- import { r as contentHash } from "./mutations-DQXddSJd.js";
6
- import { n as projectExtractBodies, t as planExtract } from "./extract-plan-D4zO7dmD.js";
2
+ import { i as DEFAULT_SKILL_LIMITS } from "./limits-DBg3UMkw.js";
3
+ import { a as measureUnit } from "./text-metrics-CyJhxWBs.js";
4
+ import { p as parseFrontmatter, r as contentHash } from "./mutations-1wLISSrY.js";
5
+ import { C as EXTRACT_PROMPT_VERSION, S as EXTRACT_PROMPT_V1, T as ownerCandidatesFromSummaries, _ as readProposalReport, b as proposalFromPlan, d as nearDuplicateSummaries, m as readExternalSupport, v as readProposalReports, w as findOwnerCandidate, x as EXTRACT_PROMPT_HASH, y as writeProposalReport } from "./quality-DNUVRbUm.js";
6
+ import { n as projectExtractBodies, t as planExtract } from "./extract-plan-ihQznLVT.js";
7
7
  import { dirname, join } from "node:path";
8
8
  //#region lib/types/extract-request.js
9
9
  /** The one human-readable owner decision shared by tool and CLI. */
@@ -108,7 +108,7 @@ async function buildExtractPlanFromLibrary(library, input) {
108
108
  candidates: lookup.candidates
109
109
  };
110
110
  }
111
- if (targetMd.length > DEFAULT_SKILL_LIMITS.maxSkillContentChars) return {
111
+ if (measureUnit(targetMd, "codePoints") > DEFAULT_SKILL_LIMITS.maxSkillContentChars) return {
112
112
  ok: false,
113
113
  message: "目标技能「" + target + "」已超过 " + DEFAULT_SKILL_LIMITS.maxSkillContentChars + " 字符,拒绝继续提取。"
114
114
  };
@@ -224,7 +224,7 @@ async function buildExtractPlanFromLibrary(library, input) {
224
224
  ok: false,
225
225
  message: plan.message
226
226
  };
227
- const projectedChars = targetMd.length + plan.plan.parts.reduce((sum, part) => sum + part.movedText.length + 2, 0);
227
+ const projectedChars = measureUnit(targetMd, "codePoints") + plan.plan.parts.reduce((sum, part) => sum + measureUnit(part.movedText, "codePoints") + 2, 0);
228
228
  if (projectedChars > DEFAULT_SKILL_LIMITS.maxSkillContentChars) return {
229
229
  ok: false,
230
230
  message: "目标「" + target + "」投影后约 " + projectedChars + " 字符,超过 " + DEFAULT_SKILL_LIMITS.maxSkillContentChars + " 上限;拒绝提取。"