@lmzhen/dsh-evolution-core 0.46.0 → 0.48.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.
- package/lib/authority-plugin.js +1 -1
- package/lib/composition/index.js +3 -3
- package/lib/{composition-Da8NfRI7.js → composition-Cqjbho0t.js} +1 -1
- package/lib/{ensure-C5Mo1dbB.js → ensure-CAjLGd9f.js} +1 -2
- package/lib/http-routes.js +21 -96
- package/lib/index.js +47 -246
- package/lib/{io-AmUf4lVY.js → io-GxghO3Ip.js} +30 -70
- package/lib/io-node.js +1 -1
- package/lib/io-registry.js +1 -35
- package/lib/{mutation-authority-DeJ_Wz14.js → mutation-authority-l57R626O.js} +17 -15
- package/lib/{mutations-DwvbjRHF.js → mutations-DQXddSJd.js} +1 -1
- package/lib/{numeric-DLeLvvGb.js → numeric-D8js3sqC.js} +1 -5
- package/lib/platform/index.js +1 -1
- package/lib/{platform-CFA12Jam.js → platform-Cc9cNt5j.js} +4 -28
- package/lib/policy.js +1 -1
- package/lib/runtime/plugin.js +21 -43
- package/lib/{session-projection-EB7mUOlJ.js → session-projection-DSXnUNZG.js} +3 -21
- package/lib/{skill-health-D1pZGk5V.js → skill-health-DP8z9TPf.js} +4 -25
- package/lib/{skill-history-CjypdYqv.js → skill-history-CxrDE3Rb.js} +54 -102
- package/lib/skills.js +166 -184
- package/lib/subagent/index.js +4 -10
- package/lib/types/authority.d.ts +2 -0
- package/lib/types/authority.js +5 -0
- package/lib/types/composition/preset-ids.d.ts +0 -1
- package/lib/types/composition/preset-ids.js +0 -1
- package/lib/types/constants.d.ts +0 -4
- package/lib/types/constants.js +0 -4
- package/lib/types/contract.d.ts +0 -5
- package/lib/types/curator.d.ts +0 -1
- package/lib/types/curator.js +0 -1
- package/lib/types/document-body.d.ts +0 -12
- package/lib/types/document-body.js +0 -14
- package/lib/types/health-baseline.d.ts +0 -13
- package/lib/types/health-baseline.js +0 -20
- package/lib/types/home-fence.d.ts +2 -0
- package/lib/types/home-fence.js +11 -1
- package/lib/types/http-routes.d.ts +9 -4
- package/lib/types/http-routes.js +36 -116
- package/lib/types/index.d.ts +0 -3
- package/lib/types/index.js +0 -3
- package/lib/types/io-registry.d.ts +0 -16
- package/lib/types/io-registry.js +0 -27
- package/lib/types/io.d.ts +6 -54
- package/lib/types/io.js +35 -65
- package/lib/types/journal-protocol.d.ts +0 -15
- package/lib/types/journal-protocol.js +1 -19
- package/lib/types/lease-store.d.ts +1 -1
- package/lib/types/lease-store.js +4 -15
- package/lib/types/live.d.ts +0 -12
- package/lib/types/live.js +0 -18
- package/lib/types/memory-store.d.ts +0 -1
- package/lib/types/memory-store.js +13 -6
- package/lib/types/mutation-authority.js +5 -0
- package/lib/types/mutation-unit.d.ts +1 -1
- package/lib/types/mutation-unit.js +14 -31
- package/lib/types/params.d.ts +11 -29
- package/lib/types/params.js +13 -60
- package/lib/types/platform/llm.d.ts +2 -3
- package/lib/types/platform/llm.js +3 -10
- package/lib/types/platform/projections.d.ts +4 -5
- package/lib/types/platform/projections.js +4 -18
- package/lib/types/probe.d.ts +0 -3
- package/lib/types/probe.js +0 -7
- package/lib/types/run-registry.js +10 -12
- package/lib/types/runtime/llm.js +2 -2
- package/lib/types/runtime/platform.d.ts +7 -11
- package/lib/types/runtime/platform.js +13 -19
- package/lib/types/runtime/plugin.d.ts +1 -1
- package/lib/types/runtime/plugin.js +6 -4
- package/lib/types/runtime/projections.js +1 -2
- package/lib/types/session-fold.d.ts +0 -8
- package/lib/types/session-fold.js +0 -5
- package/lib/types/session-projection.js +2 -2
- package/lib/types/skill-discovery.d.ts +0 -2
- package/lib/types/skill-discovery.js +1 -2
- package/lib/types/skill-health.d.ts +29 -1
- package/lib/types/skill-history.d.ts +0 -24
- package/lib/types/skill-history.js +0 -41
- package/lib/types/skill-lint.d.ts +0 -3
- package/lib/types/skill-lint.js +0 -12
- package/lib/types/skill-store.d.ts +6 -0
- package/lib/types/skill-store.js +130 -142
- package/lib/types/subagent/readiness.d.ts +0 -1
- package/lib/types/subagent/readiness.js +2 -8
- package/lib/types/tool-dispatch.d.ts +1 -16
- package/lib/types/tool-dispatch.js +0 -18
- package/lib/types/unit-journal.d.ts +1 -1
- package/lib/types/unit-journal.js +20 -15
- package/lib/types/unit-storage.d.ts +1 -1
- package/lib/types/unit-storage.js +5 -16
- package/lib/types/write-inventory.d.ts +0 -4
- package/lib/types/write-inventory.js +0 -9
- package/lib/types/write-kernel.d.ts +3 -4
- package/lib/types/write-kernel.js +13 -25
- package/lib/write.js +2 -2
- package/package.json +1 -1
- package/persisted-write-inventory.json +72 -9
- package/lib/types/fold-untrusted.d.ts +0 -35
- package/lib/types/fold-untrusted.js +0 -44
- package/lib/types/unit-recovery.d.ts +0 -5
- package/lib/types/unit-recovery.js +0 -12
|
@@ -668,47 +668,6 @@ export function textDiffFacts(before, after, path, maxLines = TEXT_DIFF_MAX_LINE
|
|
|
668
668
|
truncated: oldWindow.cut || newWindow.cut,
|
|
669
669
|
};
|
|
670
670
|
}
|
|
671
|
-
/** Characters one generated summary may carry. */
|
|
672
|
-
export const VERSION_SUMMARY_MAX_CHARS = 80;
|
|
673
|
-
/**
|
|
674
|
-
* The fixed prompt the optional per-write summarizer runs (registry `skillVersionSummary`).
|
|
675
|
-
*
|
|
676
|
-
* Model-visible, so it is written from the model’s perspective and pinned: the tests assert that it
|
|
677
|
-
* carries the skill name, the character cap and both bodies, because a silent change to a prompt is a
|
|
678
|
-
* silent change to what every recorded version says.
|
|
679
|
-
* @param input - the skill, the action, and the two bodies (null when absent).
|
|
680
|
-
* @returns the prompt text.
|
|
681
|
-
*/
|
|
682
|
-
export function versionSummaryPrompt(input) {
|
|
683
|
-
return [
|
|
684
|
-
'You are writing ONE line that tells a reader what this single edit to the agent skill',
|
|
685
|
-
'"' + input.name + '" changed. The edit action was "' + input.action + '".',
|
|
686
|
-
'Rules: at most ' + String(VERSION_SUMMARY_MAX_CHARS) + ' characters; the same language as the body;',
|
|
687
|
-
'name the decision, number or section that moved (for example "keeps 30 days instead of 90 days");',
|
|
688
|
-
'never say merely that something changed; no preamble, quotes, markdown or trailing period.',
|
|
689
|
-
'',
|
|
690
|
-
'Body BEFORE the edit:',
|
|
691
|
-
input.before ?? '(the skill did not exist before this edit)',
|
|
692
|
-
'',
|
|
693
|
-
'Body AFTER the edit:',
|
|
694
|
-
input.after ?? '(the skill does not exist after this edit)',
|
|
695
|
-
].join('\n');
|
|
696
|
-
}
|
|
697
|
-
/**
|
|
698
|
-
* Reduce a model answer to the one line the index stores.
|
|
699
|
-
* @param raw - the model’s answer, whatever shape it came in.
|
|
700
|
-
* @param maxChars - the character cap.
|
|
701
|
-
* @returns the one line, or undefined when there is nothing usable (callers store no summary).
|
|
702
|
-
*/
|
|
703
|
-
export function normalizeVersionSummary(raw, maxChars = VERSION_SUMMARY_MAX_CHARS) {
|
|
704
|
-
const firstLine = raw.split('\n').map(line => line.trim()).find(line => line !== '');
|
|
705
|
-
if (firstLine === undefined)
|
|
706
|
-
return undefined;
|
|
707
|
-
const stripped = firstLine.replace(/^["'`*•s]+/u, '').replace(/["'`*s]+$/u, '').replace(/[。.]$/u, '').trim();
|
|
708
|
-
if (stripped === '')
|
|
709
|
-
return undefined;
|
|
710
|
-
return stripped.length > maxChars ? stripped.slice(0, maxChars - 1) + '…' : stripped;
|
|
711
|
-
}
|
|
712
671
|
/**
|
|
713
672
|
* How long ago an ISO timestamp was, as a bucket plus a count — never as a sentence.
|
|
714
673
|
*
|
|
@@ -54,8 +54,5 @@ export declare function diffFindings(before: readonly LintFinding[], after: read
|
|
|
54
54
|
worsened: LintFinding[];
|
|
55
55
|
resolved: string[];
|
|
56
56
|
};
|
|
57
|
-
/** Support files = markdown files under references/ (contract §4: unit frozen, underscore-prefixed
|
|
58
|
-
* excluded). Paths are supplied by the caller — this module never touches the filesystem. */
|
|
59
|
-
export declare function countReferenceFiles(paths: readonly string[]): number;
|
|
60
57
|
export {};
|
|
61
58
|
//# sourceMappingURL=skill-lint.d.ts.map
|
package/lib/types/skill-lint.js
CHANGED
|
@@ -108,16 +108,4 @@ export function diffFindings(before, after) {
|
|
|
108
108
|
const resolved = before.filter(f => !afterByRule.has(f.rule)).map(f => f.rule);
|
|
109
109
|
return { introduced, worsened, resolved };
|
|
110
110
|
}
|
|
111
|
-
/** Support files = markdown files under references/ (contract §4: unit frozen, underscore-prefixed
|
|
112
|
-
* excluded). Paths are supplied by the caller — this module never touches the filesystem. */
|
|
113
|
-
export function countReferenceFiles(paths) {
|
|
114
|
-
return paths.filter((p) => {
|
|
115
|
-
const n = p.replace(/\\/g, '/');
|
|
116
|
-
const inReferences = n.includes('/references/') || n.startsWith('references/');
|
|
117
|
-
if (!inReferences || !n.endsWith('.md'))
|
|
118
|
-
return false;
|
|
119
|
-
const base = n.slice(n.lastIndexOf('/') + 1);
|
|
120
|
-
return !base.startsWith('_');
|
|
121
|
-
}).length;
|
|
122
|
-
}
|
|
123
111
|
//# sourceMappingURL=skill-lint.js.map
|
|
@@ -365,6 +365,10 @@ export declare class SkillLibrary {
|
|
|
365
365
|
*/
|
|
366
366
|
private unitHeadForOps;
|
|
367
367
|
private withMutationLock;
|
|
368
|
+
/** The one MutationUnit constructor: storage ports are fixed here, callers pass the rest. */
|
|
369
|
+
private commitUnit;
|
|
370
|
+
/** The one frontmatter pipeline for create/update/patch; patch keeps its cap checks outside. */
|
|
371
|
+
private prepareBody;
|
|
368
372
|
private lockPort;
|
|
369
373
|
private recovery;
|
|
370
374
|
/** Run the boot recovery once per library instance, before the first write. */
|
|
@@ -628,6 +632,7 @@ export declare class SkillLibrary {
|
|
|
628
632
|
/** Mark merge-absorbed sources archived in the usage sidecar (FR-DATA-07). */
|
|
629
633
|
private foldArchivedUsage;
|
|
630
634
|
archive(rawName: string, options?: ArchiveOptions, origin?: WriteOrigin): Promise<SkillActionResult>;
|
|
635
|
+
private archiveCore;
|
|
631
636
|
/**
|
|
632
637
|
* Commit one merge plan as a single multi-skill transaction.
|
|
633
638
|
*
|
|
@@ -719,6 +724,7 @@ export declare class SkillLibrary {
|
|
|
719
724
|
* path back. The `.archive-reason` marker is dropped on restore.
|
|
720
725
|
*/
|
|
721
726
|
restoreFromArchive(rawName: string, origin?: WriteOrigin): Promise<SkillActionResult>;
|
|
727
|
+
private restoreFromArchiveCore;
|
|
722
728
|
writeSupportFile(rawName: string, filePath: string, content: string, origin?: WriteOrigin, anchor?: WriteAnchor): Promise<SkillActionResult>;
|
|
723
729
|
private writeSupportFileCore;
|
|
724
730
|
removeSupportFile(rawName: string, filePath: string, origin?: WriteOrigin, anchor?: WriteAnchor, unitId?: string): Promise<SkillActionResult>;
|