@volter/supercode-teams 0.3.188 → 0.3.190
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/live-sessions.mjs +20 -3
- package/package.json +2 -2
package/live-sessions.mjs
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
// - Messaging tools: the marker a `message mcp` server writes for its session process, with the server alive.
|
|
15
15
|
import { EventEmitter } from 'node:events';
|
|
16
16
|
import { execFile } from 'node:child_process';
|
|
17
|
-
import { closeSync, existsSync, mkdirSync, openSync, readFileSync, readSync, readdirSync, realpathSync, renameSync, rmSync, unlinkSync, watch, writeFileSync } from 'node:fs';
|
|
17
|
+
import { closeSync, existsSync, mkdirSync, openSync, readFileSync, readSync, readdirSync, readlinkSync, realpathSync, renameSync, rmSync, unlinkSync, watch, writeFileSync } from 'node:fs';
|
|
18
18
|
import { homedir } from 'node:os';
|
|
19
19
|
import { dirname, join } from 'node:path';
|
|
20
20
|
import { FrontendClient } from '@volter/supercode-frontend';
|
|
@@ -849,8 +849,7 @@ async function ancestryOf(pid, timeout = 5000) {
|
|
|
849
849
|
* (2026-10-07: "exactly one rollout" left a session that had spawned subagents unable to read or send its own mail.)
|
|
850
850
|
*/
|
|
851
851
|
async function rolloutSession(pid, thread, timeout = 5000) {
|
|
852
|
-
const
|
|
853
|
-
const rollouts = [...new Set(out.split('\n').filter((line) => line.startsWith('n') && /rollout-[^/]*\.jsonl$/.test(line)).map((line) => line.slice(1)))];
|
|
852
|
+
const rollouts = [...new Set((await openFiles(pid, timeout)).filter((path) => /rollout-[^/]*\.jsonl$/.test(path)))];
|
|
854
853
|
// the thread each rollout is of, by the id its file is named with: the claim is one of those ids whole, never a part
|
|
855
854
|
// of a path (a rollout's name also carries its date, in the same letters a thread id is checked for)
|
|
856
855
|
const idOf = (path) => /([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.jsonl$/.exec(path)?.[1] ?? null;
|
|
@@ -877,6 +876,24 @@ async function rolloutSession(pid, thread, timeout = 5000) {
|
|
|
877
876
|
return roots[0];
|
|
878
877
|
}
|
|
879
878
|
|
|
879
|
+
/**
|
|
880
|
+
* The files process `pid` holds open, by path. Linux keeps them as links under /proc/<pid>/fd, read with no program (a
|
|
881
|
+
* machine there may have no lsof at all, and every Codex session on it was then no one to mail); a process whose table
|
|
882
|
+
* this one may not read, and every other system, is asked of lsof. Empty when neither can say.
|
|
883
|
+
*/
|
|
884
|
+
async function openFiles(pid, timeout = 5000) {
|
|
885
|
+
if (process.platform === 'linux') {
|
|
886
|
+
try {
|
|
887
|
+
const dir = `/proc/${pid}/fd`;
|
|
888
|
+
const paths = [];
|
|
889
|
+
for (const fd of readdirSync(dir)) { try { paths.push(readlinkSync(`${dir}/${fd}`)); } catch { /* closed since it was listed */ } }
|
|
890
|
+
return paths;
|
|
891
|
+
} catch { /* another user's process, or no /proc mounted: lsof, where there is one */ }
|
|
892
|
+
}
|
|
893
|
+
const out = await new Promise((resolve) => execFile(tool('lsof'), ['-a', '-p', String(pid), '-Fn'], { timeout, maxBuffer: 16 * 1024 * 1024 }, (_error, stdout) => resolve(String(stdout ?? ''))));
|
|
894
|
+
return out.split('\n').filter((line) => line.startsWith('n')).map((line) => line.slice(1));
|
|
895
|
+
}
|
|
896
|
+
|
|
880
897
|
/** A rollout's first line (its session's own record), read from the file's head; null when it cannot be read. */
|
|
881
898
|
function rolloutHead(path) {
|
|
882
899
|
let file = null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volter/supercode-teams",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.190",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A machine daemon serving this machine's doors, and a local or remote Teams server for shared session discovery, OpenTelemetry ingestion and access to enrolled machines.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"@volter/supercode-interchange": "0.1.9",
|
|
88
88
|
"@volter/supercode-terminal": "^0.2.54",
|
|
89
89
|
"@volter/supercode-trace": "^0.1.0",
|
|
90
|
-
"@volter/teams": "0.2.
|
|
90
|
+
"@volter/teams": "0.2.46",
|
|
91
91
|
"@xterm/addon-serialize": "^0.14.0",
|
|
92
92
|
"@xterm/headless": "^6.0.0",
|
|
93
93
|
"protobufjs": "8.8.0",
|