@volter/supercode-interchange 0.1.22 → 0.1.24

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 (129) hide show
  1. package/LICENSE-diffy-MIT +23 -0
  2. package/README.md +422 -2
  3. package/channel-records.mjs +71 -0
  4. package/channel-session-counts.mjs +81 -0
  5. package/channels-read.mjs +90 -0
  6. package/corpus-audit-records.mjs +192 -0
  7. package/corpus-audit-render.mjs +47 -0
  8. package/corpus-audit-schema.mjs +89 -0
  9. package/corpus-audit.d.ts +16 -0
  10. package/corpus-audit.mjs +132 -0
  11. package/file-io.mjs +21 -2
  12. package/harness-settings.mjs +19 -0
  13. package/hermes-fire-links.mjs +135 -0
  14. package/hermes-fires.mjs +106 -0
  15. package/hermes-read-home.d.ts +3 -0
  16. package/hermes-read-home.mjs +235 -0
  17. package/hermes-read-store.mjs +49 -0
  18. package/hermes-read-validation.mjs +170 -0
  19. package/hermes-read-workflow.mjs +164 -0
  20. package/hermes-read-yaml.mjs +68 -0
  21. package/hermes-store.mjs +1 -1
  22. package/homes.mjs +2 -2
  23. package/index.d.ts +14 -1
  24. package/index.mjs +1 -1
  25. package/inspection-builtin-tools.json +261 -0
  26. package/inspection-config-fields.json +765 -0
  27. package/inspection-schemas.d.ts +4 -0
  28. package/inspection-schemas.mjs +117 -0
  29. package/job-notepad-read.mjs +97 -0
  30. package/jobs-control.mjs +250 -0
  31. package/jobs-read.mjs +198 -0
  32. package/jsonl.mjs +4 -3
  33. package/memory-show.mjs +187 -0
  34. package/metadata.mjs +45 -3
  35. package/native-json.mjs +46 -3
  36. package/ontology-contracts.d.ts +5 -0
  37. package/ontology-contracts.mjs +29 -0
  38. package/ontology-operations.json +198 -0
  39. package/ontology-schemas.json +7946 -0
  40. package/openclaw-jobs-read.mjs +117 -0
  41. package/openclaw-profile-home.mjs +142 -0
  42. package/orchestrator-read-records.mjs +112 -0
  43. package/orchestrator-store.mjs +21 -9
  44. package/package.json +59 -4
  45. package/parity-ledger.json +6984 -0
  46. package/parity-orchestration.json +5538 -0
  47. package/parity-report.d.ts +7 -0
  48. package/parity-report.mjs +46 -0
  49. package/preset-profiles.mjs +27 -0
  50. package/profile-command.mjs +32 -0
  51. package/profile-orchestrator-door.mjs +104 -0
  52. package/profile-paths.mjs +25 -0
  53. package/profiles-control.mjs +98 -0
  54. package/profiles-read.mjs +119 -0
  55. package/reduction-attribution.mjs +54 -0
  56. package/reduction-diff.mjs +165 -0
  57. package/reduction-log.mjs +177 -0
  58. package/reduction-view.mjs +145 -0
  59. package/retained-projection.mjs +9 -0
  60. package/routes-read.mjs +103 -0
  61. package/runs-read.mjs +224 -0
  62. package/session-activity.d.ts +23 -0
  63. package/session-activity.mjs +124 -0
  64. package/session-append-scan.mjs +27 -17
  65. package/session-branch-handoff.mjs +115 -0
  66. package/session-claude-graph.mjs +29 -7
  67. package/session-claude-index.mjs +732 -114
  68. package/session-claude-runtime.d.ts +28 -0
  69. package/session-claude-runtime.mjs +171 -6
  70. package/session-claude-scan-store.mjs +164 -0
  71. package/session-claude.mjs +9 -0
  72. package/session-codex-activity.d.ts +6 -0
  73. package/session-codex-activity.mjs +120 -0
  74. package/session-codex-window.mjs +24 -4
  75. package/session-config-scan.mjs +141 -0
  76. package/session-convert.d.ts +33 -0
  77. package/session-convert.mjs +179 -0
  78. package/session-emission-version.json +1 -0
  79. package/session-file.mjs +11 -1
  80. package/session-follower.mjs +17 -5
  81. package/session-fresh-id.mjs +15 -0
  82. package/session-hermes-import.mjs +61 -0
  83. package/session-hermes.mjs +1 -1
  84. package/session-import.mjs +37 -0
  85. package/session-inspect.d.ts +18 -0
  86. package/session-inspect.mjs +122 -0
  87. package/session-machine-tree.d.ts +33 -0
  88. package/session-machine-tree.mjs +274 -0
  89. package/session-materialize-files.mjs +78 -0
  90. package/session-materialize-opencode.mjs +137 -0
  91. package/session-materialize.mjs +186 -0
  92. package/session-message.mjs +85 -0
  93. package/session-model.d.ts +9 -0
  94. package/session-model.mjs +1 -0
  95. package/session-opencode-store.mjs +39 -3
  96. package/session-path.mjs +6 -3
  97. package/session-pi-content.mjs +7 -2
  98. package/session-read.d.ts +134 -2
  99. package/session-read.mjs +86 -9
  100. package/session-recorded-config.mjs +3 -2
  101. package/session-records.mjs +12 -6
  102. package/session-residue-store.mjs +90 -0
  103. package/session-residue.mjs +150 -0
  104. package/session-resume-instructions.mjs +1 -1
  105. package/session-saved-read.mjs +105 -0
  106. package/session-transfer.mjs +141 -0
  107. package/session-views.mjs +1 -0
  108. package/session-write-claude.mjs +135 -0
  109. package/session-write-codex.mjs +146 -0
  110. package/session-write-gemini.mjs +77 -0
  111. package/session-write-goose.mjs +99 -0
  112. package/session-write-grok.mjs +70 -0
  113. package/session-write-native.mjs +41 -0
  114. package/session-write-opencode.mjs +197 -0
  115. package/session-write-pi.mjs +130 -0
  116. package/session-write-residue.mjs +19 -0
  117. package/session-write-utils.mjs +77 -0
  118. package/session-write.d.ts +10 -0
  119. package/session-write.mjs +37 -0
  120. package/skill-toml.mjs +80 -0
  121. package/skills-control.mjs +193 -0
  122. package/skills-list.mjs +237 -0
  123. package/source-files.mjs +12 -2
  124. package/sqlite-reader.mjs +134 -18
  125. package/support-registry.json +402 -0
  126. package/support-report.mjs +69 -0
  127. package/trigger-records.mjs +77 -0
  128. package/triggers-read.mjs +67 -0
  129. package/workflow-read.mjs +165 -0
@@ -18,8 +18,9 @@ function compactBoundary(value) {
18
18
  };
19
19
  }
20
20
 
21
- /** Claude's active branch and compaction projection. Semantic reads may name
22
- * degraded segments; stricter continuation/export reads never guess a graph. */
21
+ /** Claude's active branch and compaction projection. Semantic reads may name degraded segments, and a history read
22
+ * (a semantic read with `history`) keeps every segment before the latest compaction; other reads cut at the latest
23
+ * boundary, and stricter continuation/export reads never guess a graph. */
23
24
  export class ClaudeReplayIndex {
24
25
  nodes = [];
25
26
  byUuid = new Map();
@@ -64,11 +65,11 @@ export class ClaudeReplayIndex {
64
65
  });
65
66
  }
66
67
 
67
- selectLines(fidelity) {
68
+ selectLines(fidelity, { history = false } = {}) {
68
69
  const lenient = fidelity === 'semantic', residue = [];
69
70
  if (this.nodes.every((node) => !conversation(node))) return { lines: this.linearLines, residue };
70
71
  if (lenient) this.#anchorDanglingParents(residue);
71
- try { return { lines: this.#project(lenient, residue), residue }; }
72
+ try { return { lines: this.#project(lenient, residue, lenient && history), residue }; }
72
73
  catch (error) {
73
74
  if (!lenient) throw error;
74
75
  residue.push(`the Claude record graph could not be projected (${error.message}); every record was stitched in transcript order instead`);
@@ -88,10 +89,13 @@ export class ClaudeReplayIndex {
88
89
  residue.push(`${dangling.length} Claude record(s) reference a parentUuid absent from the transcript and were anchored as segment roots: ${listed}`);
89
90
  }
90
91
 
91
- #project(lenient, residue) {
92
+ #project(lenient, residue, history) {
92
93
  const retained = this.nodes.map(() => true);
94
+ // Compaction cuts what the model is given, not the conversation: a history read is a view, and keeps every segment
95
+ // before the latest boundary in transcript order, as Claude Code's own transcript view (ctrl+o) does. Every other
96
+ // read starts at the latest boundary.
93
97
  const boundary = this.nodes.findLastIndex((node) => node.compact != null);
94
- if (boundary !== -1) {
98
+ if (boundary !== -1 && !history) {
95
99
  const parents = lenient ? this.nodes.map((node) => node.parent) : null;
96
100
  try { this.#applyCompaction(boundary, retained); }
97
101
  catch (error) {
@@ -111,6 +115,12 @@ export class ClaudeReplayIndex {
111
115
  while (!conversation(this.nodes[active])) {
112
116
  if (seeking.has(active)) throw claudeReplayError('cycle while resolving active Claude leaf');
113
117
  seeking.add(active);
118
+ // A history read whose newest records open a segment with no conversation yet (a compaction's boundary and its
119
+ // attachments, written before the summary that opens it) is read from the newest conversation record before them.
120
+ if (history && this.nodes[active].parent == null) {
121
+ const newest = this.nodes.findLastIndex((node, index) => retained[index] && !node.sidechain && conversation(node));
122
+ if (newest !== -1) { active = newest; break; }
123
+ }
114
124
  active = this.#parentIndex(active, retained);
115
125
  }
116
126
  const children = new Map();
@@ -120,9 +130,20 @@ export class ClaudeReplayIndex {
120
130
  children.get(node.parent).push(index);
121
131
  });
122
132
  const segments = [this.#projectSegment(active, retained, sidechainOnly, lenient, children)];
123
- if (lenient) {
133
+ if (lenient && !history) {
124
134
  for (const leaf of this.#severedLeaves(active, retained)) segments.push(this.#projectSegment(leaf, retained, sidechainOnly, lenient, children));
125
135
  if (segments.length > 1) residue.push(`${segments.length} conversation segments were stitched in transcript order because the Claude record graph is severed`);
136
+ } else if (history) {
137
+ // The transcript's opening and each compaction start a segment of their own; any other root is a severed graph.
138
+ const roots = new Map(), opening = this.nodes.findIndex(conversation);
139
+ const openingRoot = opening === -1 ? null : this.#componentRoot(opening, retained, roots);
140
+ let severed = 0;
141
+ for (const leaf of this.#severedLeaves(active, retained)) {
142
+ segments.push(this.#projectSegment(leaf, retained, sidechainOnly, lenient, children));
143
+ const root = this.#componentRoot(leaf, retained, roots);
144
+ if (root !== openingRoot && this.nodes[root]?.compact == null) severed++;
145
+ }
146
+ if (severed > 0) residue.push(`${severed + 1} conversation segments were stitched in transcript order because the Claude record graph is severed`);
126
147
  }
127
148
  const firstLine = (segment) => segment.reduce((first, index) => Math.min(first, this.nodes[index].lineIndex), Infinity);
128
149
  const ordered = [], placed = new Set();
@@ -149,6 +170,7 @@ export class ClaudeReplayIndex {
149
170
  else if (this.segmentAnchors.has(node.parent) || sidechainOnly) cursor = null;
150
171
  else throw claudeReplayError(`active Claude record \`${node.uuid}\` has missing parentUuid \`${node.parent}\``);
151
172
  if (cursor != null && !retained[cursor]) {
173
+ // A compaction boundary is where this segment ends; the records it pruned stay pruned.
152
174
  if (lenient) break;
153
175
  throw claudeReplayError(`active Claude chain crosses an excluded compaction record from \`${node.uuid}\``);
154
176
  }