@volter/supercode-interchange 0.1.10 → 0.1.11

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/jsonl.mjs +6 -2
  2. package/package.json +1 -1
package/jsonl.mjs CHANGED
@@ -30,13 +30,17 @@ async function readHeader(reader, harness) {
30
30
  }
31
31
 
32
32
  async function descriptor(path, harness, reader, header, facts, nativeTopic) {
33
- const sessionId = header.session_id ?? basename(path, extname(path));
33
+ // A Claude subagent's transcript (`<session>/subagents/agent-<id>.jsonl`) carries its parent's sessionId in every
34
+ // record: named by that id it would share its parent's index key, replace the parent's row and, as a child, drop
35
+ // the parent from discovery. It is named by its own file, under its parent.
36
+ const subagentOf = harness === 'claude-code' && basename(dirname(path)) === 'subagents' ? basename(dirname(dirname(path))) : null;
37
+ const sessionId = subagentOf ? basename(path, extname(path)) : header.session_id ?? basename(path, extname(path));
34
38
  let title = header.title ?? header.topic;
35
39
  if (title == null && harness === 'codex') {
36
40
  if (typeof nativeTopic !== 'function') throw new Error('Codex metadata requires its native thread-name source');
37
41
  title = await nativeTopic(path, sessionId);
38
42
  }
39
- const parent = header.parent_session_id ?? (harness === 'claude-code' && basename(dirname(path)) === 'subagents' ? basename(dirname(dirname(path))) : null);
43
+ const parent = header.parent_session_id ?? subagentOf;
40
44
  return finalizeNouns({
41
45
  locator: { harness, session_id: sessionId, storage: { kind: 'file', path } },
42
46
  cwd: header.cwd, title, updated_at_ms: facts.last_turn_ms ?? reader.modified_ms,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/supercode-interchange",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "type": "module",
5
5
  "description": "Read-only harness metadata, transcript codecs and session projections for Supercode",
6
6
  "license": "MIT OR Apache-2.0",