opencode-fractal-memory 0.6.13 → 0.6.14

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.
@@ -2,6 +2,7 @@ import { memLog, memLogSimple, setSessionId } from "../logging";
2
2
  import { generateFileSummary, generateFileLabel, SOURCE_FILE_EXTENSIONS } from "../file-summary";
3
3
  import { distillRules, predictiveRateToolCall, applyScoreDecay } from "../hooks";
4
4
  import * as fs from "node:fs";
5
+ let activeSessionCount = 0;
5
6
  export function createHookHandlers(store, client, memConfig, ruleCache, ruleCacheDirty, sessionInjectionLock, latestUserMessage, managementServer) {
6
7
  return {
7
8
  "experimental.chat.system.transform": async (input, output) => {
@@ -155,6 +156,7 @@ export function createHookHandlers(store, client, memConfig, ruleCache, ruleCach
155
156
  const sessionId = properties.info?.id ?? "unknown";
156
157
  await store.createSessionMetrics(sessionId);
157
158
  setSessionId(sessionId);
159
+ activeSessionCount++;
158
160
  managementServer.start();
159
161
  }
160
162
  else if (type === "session.idle") {
@@ -168,7 +170,10 @@ export function createHookHandlers(store, client, memConfig, ruleCache, ruleCach
168
170
  }
169
171
  }
170
172
  else if (type === "session.deleted") {
171
- managementServer.stop();
173
+ activeSessionCount = Math.max(0, activeSessionCount - 1);
174
+ if (activeSessionCount === 0) {
175
+ managementServer.stop();
176
+ }
172
177
  }
173
178
  },
174
179
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-fractal-memory",
3
- "version": "0.6.13",
3
+ "version": "0.6.14",
4
4
  "description": "Fractal memory system for OpenCode with semantic search and automatic compression.",
5
5
  "main": "dist/plugin.js",
6
6
  "exports": {