@aixle/insights 0.2.8-staging → 0.2.9-staging
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/dist/readers/claude.d.ts
CHANGED
|
@@ -59,7 +59,6 @@ export interface ClaudeTranscriptTurn {
|
|
|
59
59
|
toolUses: ClaudeCollectedToolUse[];
|
|
60
60
|
navToolCalls: number;
|
|
61
61
|
totalToolCalls: number;
|
|
62
|
-
messageIds: string[];
|
|
63
62
|
/**
|
|
64
63
|
* Fingerprint of the turn's content (prompt + assistant text + tool-use set).
|
|
65
64
|
* A turn keeps the same turnId as Claude appends more tool_use blocks to it,
|
|
@@ -67,6 +66,8 @@ export interface ClaudeTranscriptTurn {
|
|
|
67
66
|
* instead of skipping the turn forever on its unchanged id (DB90DV-259).
|
|
68
67
|
*/
|
|
69
68
|
contentHash: string;
|
|
69
|
+
messageIds: string[];
|
|
70
|
+
requestIds: string[];
|
|
70
71
|
}
|
|
71
72
|
/** Payload shape for the parent chat turn (carries full token cost). */
|
|
72
73
|
export interface ClaudePayload extends IngestPayload {
|
|
@@ -99,6 +100,7 @@ export interface ClaudePayload extends IngestPayload {
|
|
|
99
100
|
nav_tool_calls: number;
|
|
100
101
|
total_tool_calls: number;
|
|
101
102
|
message_ids?: string[];
|
|
103
|
+
request_ids?: string[];
|
|
102
104
|
};
|
|
103
105
|
}
|
|
104
106
|
/** Payload shape for derivative tool-use children (cost_usd: 0, no tokens). */
|
package/dist/readers/claude.js
CHANGED
|
@@ -206,8 +206,9 @@ function newTurn(sessionId, turnIndex, filePath, fileSize, occurredAt, promptId)
|
|
|
206
206
|
toolUses: [],
|
|
207
207
|
navToolCalls: 0,
|
|
208
208
|
totalToolCalls: 0,
|
|
209
|
-
messageIds: [],
|
|
210
209
|
contentHash: "",
|
|
210
|
+
messageIds: [],
|
|
211
|
+
requestIds: [],
|
|
211
212
|
persisted: false,
|
|
212
213
|
};
|
|
213
214
|
}
|
|
@@ -227,7 +228,7 @@ function computeTurnContentHash(turn) {
|
|
|
227
228
|
turn.promptText,
|
|
228
229
|
turn.assistantText,
|
|
229
230
|
toolFingerprint,
|
|
230
|
-
].join("
|
|
231
|
+
].join(" ");
|
|
231
232
|
return createHash("sha256").update(material).digest("hex").slice(0, 32);
|
|
232
233
|
}
|
|
233
234
|
function appendText(existing, addition) {
|
|
@@ -394,6 +395,9 @@ export async function parseTranscriptFile(filePath, verbose = false) {
|
|
|
394
395
|
if (entry.message.id && !currentTurn.messageIds.includes(entry.message.id)) {
|
|
395
396
|
currentTurn.messageIds.push(entry.message.id);
|
|
396
397
|
}
|
|
398
|
+
if (entry.requestId && !currentTurn.requestIds.includes(entry.requestId)) {
|
|
399
|
+
currentTurn.requestIds.push(entry.requestId);
|
|
400
|
+
}
|
|
397
401
|
currentTurn.occurredAt = timestamp > currentTurn.occurredAt ? timestamp : currentTurn.occurredAt;
|
|
398
402
|
const text = extractContentText(entry.message.content).join("\n\n").trim();
|
|
399
403
|
currentTurn.assistantText = appendText(currentTurn.assistantText, text);
|
|
@@ -449,6 +453,7 @@ export function mapTranscriptTurn(turn, options) {
|
|
|
449
453
|
nav_tool_calls: turn.navToolCalls,
|
|
450
454
|
total_tool_calls: turn.totalToolCalls,
|
|
451
455
|
message_ids: turn.messageIds.length > 0 ? turn.messageIds : undefined,
|
|
456
|
+
request_ids: turn.requestIds.length > 0 ? turn.requestIds : undefined,
|
|
452
457
|
},
|
|
453
458
|
};
|
|
454
459
|
if (turn.model)
|
package/package.json
CHANGED