@lmzhen/dsh-evolution-core 0.1.0-rc.41 → 0.1.0-rc.43
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/index.js +5 -2
- package/lib/types/events.d.ts +18 -10
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -2117,7 +2117,7 @@ var SkillLibrary = class {
|
|
|
2117
2117
|
try {
|
|
2118
2118
|
for (const source of normalizedSources) {
|
|
2119
2119
|
const result = await this.archive(source, { absorbedInto: target });
|
|
2120
|
-
if (!result.ok)
|
|
2120
|
+
if (!result.ok) throw new Error(result.message);
|
|
2121
2121
|
archived.push(source);
|
|
2122
2122
|
}
|
|
2123
2123
|
await this.io.writeText(join(targetDir, "SKILL.md"), merged);
|
|
@@ -2261,7 +2261,10 @@ var SkillLibrary = class {
|
|
|
2261
2261
|
* listed in the manifest and only those names are ever read back.
|
|
2262
2262
|
*/
|
|
2263
2263
|
async snapshotAll(reason = "pre-mutation", extras = []) {
|
|
2264
|
-
const
|
|
2264
|
+
const backupRoot = join(this.root, ".backups");
|
|
2265
|
+
const stamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
2266
|
+
let dest = join(backupRoot, `skills-${stamp}`);
|
|
2267
|
+
while (await this.io.exists(dest)) dest = join(backupRoot, `skills-${stamp}-${Math.random().toString(36).slice(2, 8)}`);
|
|
2265
2268
|
const names = await listNames(this.root, this.io);
|
|
2266
2269
|
for (const name of names) await this.io.copy(skillDir(this.root, name), join(dest, name));
|
|
2267
2270
|
const sidecars = [];
|
package/lib/types/events.d.ts
CHANGED
|
@@ -1,15 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* Process-local events emitted by the evolution family on the cordis event
|
|
3
|
+
* bus. Consumers subscribe with `ctx.on(...)`; producers dispatch with
|
|
4
|
+
* `ctx.emit(...)`.
|
|
5
|
+
*
|
|
6
|
+
* These are deliberately NOT session events: a persisted session log may only
|
|
7
|
+
* contain types from the host's generated `KNOWN_SESSION_EVENT_TYPES` set —
|
|
8
|
+
* the persistence read path refuses to interpret a log carrying any other
|
|
9
|
+
* type unless the envelope marks it `ignorable`, and `Session.append` offers
|
|
10
|
+
* no channel to write that marker. Appending any `evolution/*` type therefore
|
|
11
|
+
* made the whole session unresumable (A-line P0-1, fixed in rc.42 by moving
|
|
12
|
+
* these events off `session.append`). Plan-outcome durability lives in the
|
|
13
|
+
* evolution-activity store, not the session log.
|
|
5
14
|
*/
|
|
6
15
|
export interface EvolutionReviewScheduledEvent {
|
|
16
|
+
/** Owning session (payload v2): process events carry no session envelope. */
|
|
17
|
+
sessionId: string;
|
|
7
18
|
kind: 'memory' | 'skill' | 'combined';
|
|
8
19
|
toolCalls: number;
|
|
9
20
|
userChars: number;
|
|
10
21
|
assistantChars: number;
|
|
11
22
|
}
|
|
12
23
|
export interface EvolutionPlanAppliedEvent {
|
|
24
|
+
/** Owning session (payload v2): process events carry no session envelope. */
|
|
25
|
+
sessionId: string;
|
|
13
26
|
planId: string;
|
|
14
27
|
/** Stable fingerprint of the policy snapshot that produced this plan. */
|
|
15
28
|
policyFingerprint?: string | undefined;
|
|
@@ -25,15 +38,10 @@ export interface EvolutionSkillMutatedEvent {
|
|
|
25
38
|
filePath?: string;
|
|
26
39
|
archivedPath?: string;
|
|
27
40
|
}
|
|
28
|
-
declare module '@deepseek-ai/dsh-session/types' {
|
|
29
|
-
interface SessionEventMap {
|
|
30
|
-
'evolution/review-scheduled': EvolutionReviewScheduledEvent;
|
|
31
|
-
'evolution/plan-applied': EvolutionPlanAppliedEvent;
|
|
32
|
-
'evolution/skill-mutated': EvolutionSkillMutatedEvent;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
41
|
declare module '@deepseek-ai/cordis' {
|
|
36
42
|
interface Events {
|
|
43
|
+
'evolution/review-scheduled'(event: EvolutionReviewScheduledEvent): void;
|
|
44
|
+
'evolution/plan-applied'(event: EvolutionPlanAppliedEvent): void;
|
|
37
45
|
'evolution/skill-mutated'(event: EvolutionSkillMutatedEvent): void;
|
|
38
46
|
}
|
|
39
47
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lmzhen/dsh-evolution-core",
|
|
3
3
|
"description": "Shared stores, prompts, signals and lifecycle logic for the dsh-evolution plugin family (community build)",
|
|
4
|
-
"version": "0.1.0-rc.
|
|
4
|
+
"version": "0.1.0-rc.43",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|