engine7 7.1.14 → 7.1.16

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 (2) hide show
  1. package/dist/cli.mjs +12 -1
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -114,6 +114,15 @@ function collectAllFiles(dir) {
114
114
  }
115
115
  return files;
116
116
  }
117
+ function readMainSessionId(platformMapPath) {
118
+ try {
119
+ if (!fs.existsSync(platformMapPath)) return null;
120
+ const map = JSON.parse(fs.readFileSync(platformMapPath, "utf-8"));
121
+ return map["scope:main"] || null;
122
+ } catch {
123
+ return null;
124
+ }
125
+ }
117
126
  function collectRecentSessions(agentsDir, _days = 7) {
118
127
  const files = [];
119
128
  if (!fs.existsSync(agentsDir)) return files;
@@ -154,7 +163,9 @@ function collectRecentSessions(agentsDir, _days = 7) {
154
163
  }
155
164
  }
156
165
  scanSessionsDir(agentsDir);
157
- for (const [, group] of sessionGroups) {
166
+ const mainSessionId = readMainSessionId(path.join(agentsDir, "main", "sessions", "platform-map.json"));
167
+ for (const [sessionKey, group] of sessionGroups) {
168
+ if (!mainSessionId || !sessionKey.includes(mainSessionId)) continue;
158
169
  if (group.jsonl) files.push(group.jsonl);
159
170
  group.archived.sort((a, b) => b.mtime - a.mtime);
160
171
  if (group.archived.length > 0) files.push(group.archived[0].file);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "engine7",
3
- "version": "7.1.14",
3
+ "version": "7.1.16",
4
4
  "type": "module",
5
5
  "description": "Engine 7 — Self-hosted AI agent engine",
6
6
  "main": "dist/main.mjs",