@volter/supercode-teams 0.3.182 → 0.3.183

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 CHANGED
@@ -851,12 +851,15 @@ async function ancestryOf(pid, timeout = 5000) {
851
851
  async function rolloutSession(pid, thread, timeout = 5000) {
852
852
  const out = await new Promise((resolve) => execFile(tool('lsof'), ['-a', '-p', String(pid), '-Fn'], { timeout, maxBuffer: 16 * 1024 * 1024 }, (_error, stdout) => resolve(String(stdout ?? ''))));
853
853
  const rollouts = [...new Set(out.split('\n').filter((line) => line.startsWith('n') && /rollout-[^/]*\.jsonl$/.test(line)).map((line) => line.slice(1)))];
854
- if (!rollouts.some((path) => path.includes(thread))) return null;
854
+ // 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
+ // of a path (a rollout's name also carries its date, in the same letters a thread id is checked for)
856
+ 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;
857
+ if (!rollouts.some((path) => idOf(path) === thread)) return null;
855
858
  if (rollouts.length === 1) return thread;
856
859
  // each thread held, with the thread that spawned it (none for one a person started)
857
860
  const parentOf = new Map();
858
861
  for (const path of rollouts) {
859
- const id = /([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.jsonl$/.exec(path)?.[1];
862
+ const id = idOf(path);
860
863
  const first = rolloutHead(path);
861
864
  if (!id || first === null) return null;
862
865
  parentOf.set(id, /"parent_thread_id"\s*:\s*"([0-9a-f-]{8,64})"/.exec(first)?.[1] ?? null);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/supercode-teams",
3
- "version": "0.3.182",
3
+ "version": "0.3.183",
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",