@volter/supercode-interchange 0.1.19 → 0.1.20

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/supercode-interchange",
3
- "version": "0.1.19",
3
+ "version": "0.1.20",
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",
@@ -158,7 +158,10 @@ export function pushClaudeAttachment(value, out) {
158
158
  }
159
159
 
160
160
  export function captureClaudeProvenance(value, messages, from = 0) {
161
- const facts = [['timestamp', stringField(value, 'timestamp')], ['claude_uuid', stringField(value, 'uuid')], ['native_msg_id', stringField(value, 'msg_id')], ['model', stringField(field(value, 'message'), 'model')]];
161
+ const origin = field(value, 'origin');
162
+ // Relay receipts identify Claude's peer message, whose ID lives in origin.
163
+ const messageId = stringField(value, 'msg_id') ?? (stringField(origin, 'kind') === 'peer' ? stringField(origin, 'msg_id') : null);
164
+ const facts = [['timestamp', stringField(value, 'timestamp')], ['claude_uuid', stringField(value, 'uuid')], ['native_msg_id', messageId], ['model', stringField(field(value, 'message'), 'model')]];
162
165
  for (let index = from; index < messages.length; index++) for (const [key, fact] of facts) {
163
166
  if (fact != null && !Object.hasOwn(messages[index].metadata, key)) messages[index].metadata[key] = fact;
164
167
  }