@lmzhen/dsh-evolution-activity 0.3.48 → 0.3.49

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 CHANGED
@@ -45,10 +45,9 @@ function applyActivityEvent(items, event, maxItems, at = Date.now()) {
45
45
  const cap = Number.isFinite(maxItems) ? Math.max(1, maxItems) : 200;
46
46
  return [...items, record].slice(-cap);
47
47
  }
48
- /** Parse a raw sidecar into records; malformed content reads as empty (best-effort telemetry). */
49
- /** Single-source activity sidecar serialization (F-304): both `saveActivity`
50
- * and the `apply()` listener emit the versioned envelope through this one
51
- * function, so a format change cannot drift across two hand-written writers.
48
+ /** Single-source activity sidecar serialization (F-304): the `apply()`
49
+ * listener emits the versioned envelope through this one function, so a
50
+ * format change cannot drift across hand-written writers.
52
51
  * `parseActivityContent` is the matching single reader. */
53
52
  function serializeActivity(items) {
54
53
  return JSON.stringify({
@@ -68,9 +67,6 @@ function parseActivityContent(raw) {
68
67
  async function loadActivity(root, io) {
69
68
  return parseActivityContent(await io.readText(activityFile(root)));
70
69
  }
71
- async function saveActivity(root, items, io) {
72
- await io.writeText(activityFile(root), serializeActivity(items));
73
- }
74
70
  const name = "evolution-activity";
75
71
  const Config = z.object({ maxItems: z.number().min(1).default(200) });
76
72
  function apply(ctx, rawConfig = {}) {
@@ -101,4 +97,4 @@ function apply(ctx, rawConfig = {}) {
101
97
  });
102
98
  }
103
99
  //#endregion
104
- export { ACTIVITY_FILE_VERSION, Config, DEFAULT_MAX_ITEMS, activityFile, apply, applyActivityEvent, loadActivity, name, parseActivityContent, saveActivity, serializeActivity };
100
+ export { ACTIVITY_FILE_VERSION, Config, DEFAULT_MAX_ITEMS, activityFile, apply, applyActivityEvent, loadActivity, name, parseActivityContent, serializeActivity };
@@ -42,15 +42,13 @@ export declare const DEFAULT_MAX_ITEMS = 200;
42
42
  export declare function activityFile(root: string): string;
43
43
  /** Fold one plan-applied payload into a bounded record list (pure). */
44
44
  export declare function applyActivityEvent(items: EvolutionActivityRecord[], event: EvolutionPlanAppliedEvent, maxItems: number, at?: number): EvolutionActivityRecord[];
45
- /** Parse a raw sidecar into records; malformed content reads as empty (best-effort telemetry). */
46
- /** Single-source activity sidecar serialization (F-304): both `saveActivity`
47
- * and the `apply()` listener emit the versioned envelope through this one
48
- * function, so a format change cannot drift across two hand-written writers.
45
+ /** Single-source activity sidecar serialization (F-304): the `apply()`
46
+ * listener emits the versioned envelope through this one function, so a
47
+ * format change cannot drift across hand-written writers.
49
48
  * `parseActivityContent` is the matching single reader. */
50
49
  export declare function serializeActivity(items: EvolutionActivityRecord[]): string;
51
50
  export declare function parseActivityContent(raw: string | null): EvolutionActivityRecord[];
52
51
  export declare function loadActivity(root: string, io: EvolutionIoLike): Promise<EvolutionActivityRecord[]>;
53
- export declare function saveActivity(root: string, items: EvolutionActivityRecord[], io: EvolutionIoLike): Promise<void>;
54
52
  export declare const name = "evolution-activity";
55
53
  export interface Config {
56
54
  /** Bounded sidecar: how many recent outcomes are kept. */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lmzhen/dsh-evolution-activity",
3
3
  "description": "Durable activity store for self-evolution plan outcomes (community build)",
4
- "version": "0.3.48",
4
+ "version": "0.3.49",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -31,7 +31,7 @@
31
31
  "license": "MIT",
32
32
  "dependencies": {
33
33
  "@deepseek-ai/schemastery": "^3.18.1",
34
- "@lmzhen/dsh-evolution-core": "^0.3.48"
34
+ "@lmzhen/dsh-evolution-core": "^0.3.49"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "@deepseek-ai/cordis": "^4.0.1",
@@ -40,8 +40,8 @@
40
40
  "devDependencies": {
41
41
  "@deepseek-ai/cordis": "^4.0.1",
42
42
  "@deepseek-ai/dsh-invariants": "^0.1.1-rc.2",
43
- "@lmzhen/dsh-evolution-core": "^0.3.48",
44
- "@lmzhen/dsh-evolution-io": "^0.3.48",
45
- "@lmzhen/dsh-evolution-io-node": "^0.3.48"
43
+ "@lmzhen/dsh-evolution-core": "^0.3.49",
44
+ "@lmzhen/dsh-evolution-io": "^0.3.49",
45
+ "@lmzhen/dsh-evolution-io-node": "^0.3.49"
46
46
  }
47
47
  }