@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
|
@@ -158,7 +158,10 @@ export function pushClaudeAttachment(value, out) {
|
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
export function captureClaudeProvenance(value, messages, from = 0) {
|
|
161
|
-
const
|
|
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
|
}
|